Accepted way to prevent “The remote host closed the connection” exception
I’m constantly getting the following exception which is caused by a user initiating a download and it consequently failing (or being cancelled):
I’m constantly getting the following exception which is caused by a user initiating a download and it consequently failing (or being cancelled):
Is there an easy way to log all exceptions in an ASP.NET application? I’m already logging unhandled exceptions through the Application_OnError event, but I want to perform logging even when an exception is handled on a page level.
I have an ASP.NET Web API web service which throws a SerializationException in certain circumstances. The problem is that I’m unable to trap and log this exception server-side — the only place it shows up is in the body of the HTTP response to the client.
My team is currently in the process of building an ASP.NET MVC application, and we’re trying to decide which of these frameworks to implement to deal with error handling and logging.
I’m cleaning up some legacy framework code and a huge amount of it is simply coding by exception. No values are checked to see if they are null, and as a result, copious amounts of exceptions are thrown and caught.
We have a lot of files, saved as binary in our SQL Server database.
I have made an .ashx file, that delivers these files, to the users.
Unfortunately, when the files become rather large, it will fail, with the following error:
I’m working on my first real asp.net web application and I’m kind of stumped on the best place and method to trap and handle database constraint violations. Suppose I have a unique constraint on a column and a user inputs something that would violate that unique constraint. Do I catch it in the business layer by making a call to the database to check of the value exists for that column or do I let it go all the way to the database and let it throw an exception and handle that in my application?
In my file repository, I will throw the following exceptions when the InsertFile() method is called:
First, I’m already familiar with the simple exception handling syntax but I’m asking about the best place, the best time and the best way to deal with them.
I know that I can do: