mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Updated csproj files, so we don't have to migrate every time. Added a fix for BUG-1863: Cannot get access to deleted object, and added some small code quality chances. [skip ci]
This commit is contained in:
parent
63e360e254
commit
4f9d6eb865
21 changed files with 112 additions and 54 deletions
|
@ -471,14 +471,20 @@ namespace GreenshotPlugin.Core {
|
|||
isHttpError = (int)response.StatusCode >= 300;
|
||||
if (isHttpError)
|
||||
{
|
||||
LOG.ErrorFormat("HTTP error {0} with content: {1}", response.StatusCode, responseData);
|
||||
LOG.ErrorFormat("HTTP error {0}", response.StatusCode);
|
||||
}
|
||||
DebugHeaders(response);
|
||||
responseData = GetResponseAsString(response);
|
||||
} catch (WebException e) {
|
||||
if (isHttpError)
|
||||
{
|
||||
LOG.ErrorFormat("HTTP response {0}", responseData);
|
||||
}
|
||||
}
|
||||
catch (WebException e) {
|
||||
response = (HttpWebResponse) e.Response;
|
||||
HttpStatusCode statusCode = response.StatusCode;
|
||||
if (response != null) {
|
||||
LOG.ErrorFormat("HTTP error {0}", response.StatusCode);
|
||||
LOG.ErrorFormat("HTTP error {0}", statusCode);
|
||||
string errorContent = GetResponseAsString(response);
|
||||
if (alsoReturnContentOnError)
|
||||
{
|
||||
|
@ -487,6 +493,10 @@ namespace GreenshotPlugin.Core {
|
|||
LOG.ErrorFormat("Content: {0}", errorContent);
|
||||
}
|
||||
LOG.Error("WebException: ", e);
|
||||
if (statusCode == HttpStatusCode.Unauthorized)
|
||||
{
|
||||
throw new UnauthorizedAccessException(e.Message);
|
||||
}
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue