Hi gang,
This is the first time I’ve customized the Main.onException method and I’m having some issues working with it. Here is what I have:
var rc = event.getCollection(); var prc = event.getCollection(private=true); var exceptionBean = event.getValue("ExceptionBean"); //log to logbox if( log.canError() ){ log.error('Error',exceptionBean); } event.renderData(data='Some JSON data would go here', type="json", statusCode="500", statusText="Sorry an Error has occurred", jsonAsText="true");The first issue i’m having is the logging is taking place however var exceptionBean does not contain anything. Secondly, instead of I’d like to return a nice JSON error message but the default exception page is being returned. How can I accomplish sending back JSON from this method. Does this require modifying the customErrorTemplate setting in the CB config file?
Thanks.
Nolan