Uncaught exception in HttpResponse Can Cause Application Crash
See original GitHub issueHello,
The SendResponse method is writing into the OutputStream in a try ... finally
block.
It so happens that sometimes there are network connection losses while writing the data.
OutputStream will raise an exception - and if it is not caught it will end up by crashing the whole process that launched RestServer.
For my initial tests, simply adding a catch
in the try ... finally
block solves the issue.
That specific request is obviously lost, but the process is not stopped any longer.
Probably adding some notification mechanism in the catch
block would be even better.
Thank you for handling this rare case.
Best regards, SoftExpert
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
App crashes on HttpResponse response = httpclient. ...
response = httpclient.execute(httpget) and raise an exception. I think that problem is url encoding but I am not sure. If I not encode...
Read more >https request ends OK but app crash due to ECONNRESET ...
I used https.request to visit an intranet server, and response is OK. ... Only process.on('uncaughtException') can catch this error but ...
Read more >Diagnosing an ASP.NET Core hard crash
The first of these causes an InvalidOperationException to be thrown. The second and third, between them, cause the app to crash.
Read more >Exception Handling in ASP.NET Web API
Describes ASP.NET Web API executes error and exception handling and provides examples for errors and exceptions.
Read more >Should exceptions be only thrown if I intend to crash the ...
No, exceptions are not always thrown just to "crash " the program. Many exceptions are recoverable. For example, in Java you may get...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi Scott,
Thank you again! I swear I am not picky 😉 , but I think there is still some place for an improvement see this GIST. WIth that one covered I think everything is good.
Best regards, SoftExpert
Hi,
is it correct that the fix to this issue is not yet part of the nugget which is still Version 4.1.1.0? Is there any plan to publish a new version with this issue fixed?
Best regards and keep up the good work findusl