Print which link failed to shorten
This commit is contained in:
parent
76fc3be986
commit
c20d743e80
@ -364,9 +364,7 @@ namespace NadekoBot.Classes
|
|||||||
}
|
}
|
||||||
|
|
||||||
var httpResponse = (await httpWebRequest.GetResponseAsync().ConfigureAwait(false)) as HttpWebResponse;
|
var httpResponse = (await httpWebRequest.GetResponseAsync().ConfigureAwait(false)) as HttpWebResponse;
|
||||||
if (httpResponse == null) return "HTTP_RESPONSE_ERROR";
|
|
||||||
var responseStream = httpResponse.GetResponseStream();
|
var responseStream = httpResponse.GetResponseStream();
|
||||||
if (responseStream == null) return "RESPONSE_STREAM ERROR";
|
|
||||||
using (var streamReader = new StreamReader(responseStream))
|
using (var streamReader = new StreamReader(responseStream))
|
||||||
{
|
{
|
||||||
var responseText = await streamReader.ReadToEndAsync().ConfigureAwait(false);
|
var responseText = await streamReader.ReadToEndAsync().ConfigureAwait(false);
|
||||||
@ -375,6 +373,7 @@ namespace NadekoBot.Classes
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
Console.WriteLine("Shortening of this url failed: " + url);
|
||||||
Console.WriteLine(ex.ToString());
|
Console.WriteLine(ex.ToString());
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user