question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught exception in HttpResponse Can Cause Application Crash

See original GitHub issue

Hello,

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:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
SoftExpertcommented, Sep 6, 2017

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

0reactions
finduslcommented, Nov 22, 2018

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found