Added support for custom error handlers

I prefer to have this functionality at this level instead of at the server level. It makes sense because it is an app-wise customization, not a server customization.