Wednesday 19 March 2008

AJAX Error Handling

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500

How to handle error 500?

An error with status code 500 indicates that there is a problem when the server tries to process the request. There can be variant causes. The problem is how to find out the real cause of the error.

Here are two ways to find it out:

1. Set a breakpoint in the code that is responsible for processing the request, then debug through it to find out the exception being thrown;
2. The real error message is usually returned in the response. We can use an HTTP Sniffer (e.g., Fiddler) to peek into the traffic between the client and server to find out the error message.

No comments: