Error handling

The web server currently has logic for handling the following errors:

No suitable handler mapping could be found

In this instance the web server will return a HTTP status code of 404, along with a short 404 message.

You can replace the 404 response message with another string by modifying the ErrorHandler collection:

myServer.ErrorHandler[HttpErrorStatus.Status404] = myErrorString;

The handler threw an unhandled exception

In this case the web server will return a HTTP status code of 500, along with a short error message.

You can replace the response error message with another string by modifying the ErrorHandler collection:

myServer.ErrorHandler[HttpErrorStatus.Status500] = myErrorString;
Note that if a handler experiences an unhandled exception, the web server will not attempt to select another handler - it will simply return a 500 error code.

Last edited Aug 3, 2010 at 11:35 AM by Kragen2uk, version 4

Comments

No comments yet.