Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Buffer support in log4net-loggly library during network outage #3
Conversation
Shwetajain148
commented
Jan 20, 2017
•
|
| } | ||
|
|
||
| catch (WebException e) { | ||
| var response = (HttpWebResponse)e.Response; |
mchaudhary
Jan 24, 2017
Will this generate Null exception ?
Will this generate Null exception ?
| { | ||
| if (response.StatusCode == HttpStatusCode.Forbidden) //Check for bad token | ||
| { | ||
| setValidInvalidFlag(false); |
mchaudhary
Jan 24, 2017
This function name is pretty funky setValidInvalidFlag. I think what we are doing is if we getting Forbidden error we are marking token as invalid so we should call this function setTokenValid(false).
This function name is pretty funky setValidInvalidFlag. I think what we are doing is if we getting Forbidden error we are marking token as invalid so we should call this function setTokenValid(false).
| if (totalRetries == 1) Console.WriteLine("Loggly error: {0}", e.Message); | ||
| } | ||
|
|
||
| else if (totalRetries == 1) |
mchaudhary
Jan 24, 2017
This logic of else if (totalRetries == 1) is also very confusing since this has no relation with above if (response != null). We should always have if and else if in conjunction. I understand what you are trying to do here. You are basically saying if there is exception and the it is not first time lets put it in buffer. I think we can make code such that it is more easy to understand.
This logic of else if (totalRetries == 1) is also very confusing since this has no relation with above if (response != null). We should always have if and else if in conjunction. I understand what you are trying to do here. You are basically saying if there is exception and the it is not first time lets put it in buffer. I think we can make code such that it is more easy to understand.
|
@mchaudhary: When response is null, I am just storing logs into buffer otherwise checking for bad token error(403). Other than bad token status, we are storing logs into the buffer. Please Review. |