Error Handling, interceptors and nothing

I am in the middle of writing a Module to handle errors, and I am not talking about the capturing of the errors for display.

I am looking into all the ways that ColdBox handles errors, and there seem to be a lot of different ways with no common point. In other words it is not very possible to use one model/service to handle all these type of errors, in the way that I need to do this.

For example, the handler can have an onError method/event that is captured for that handler. But if it doesn’t then it is automatically thrown back to somewhere else in the system to handle. In that example, this is a problem for what I am looking at wanting to do, because there is no pre/post handling on the onError for handlers. The solution would be to DI a service in and call that inside the handler for each and every handler, but a nicer approach would be an interceptor that would be called.

If you think about this you can see that some areas of the system is great because you have all these interception points, others are far from perfect. And that is only because we as developers are beginning to push the boundaries of this great framework even further.

So the ultimate question here, how easy and quickly could something like this be done. Where every single place that can handle the caption of errors, be able to handle these interceptors, right down to the application.cfc on error event if used?

The ultimate aim here is to have one model/service that can intercept and/or control the handling of all errors gracefully.


Andrew Scott

I would use the interceptor point onException to do some logging and
use your main handler onException() and onInvalidEvent() to redirect
the user to "an error occurred" page.


Except I am not looking at doing this for displaying a custom error page,
otherwise I would.

Andrew Scott

From: [] On
Behalf Of Ernst van der Linden
Sent: Friday, 24 December 2010 12:24 PM
Subject: Re: [coldbox:7379] Error Handling, interceptors and nothing

I would use the interceptor point onException to do some logging and use
your main handler onException() and onInvalidEvent() to redirect the user


Andrew, can you expand on this.

I am not fully satisfied either with error handling approaches and would love to find some more expanded direction on it for 3.1. What would this error handling look like and please be as detailed as possible. Right now here is what exists from the most specific to most abstract

  • onError() convention when an error occurs in a specific handler
  • if no onError(), it bubbles up to the onException interceptor
  • After this interceptor, we do the exception handler method (if defined)
  • Custom or System bug error template gets rendered

Ideas, thoughts?

Luis F. Majano
Ortus Solutions, Corp

ColdBox Platform:
Linked In:
IECFUG Manager:

Luis, I am not sure I can at the moment.

I used the onError event in the handler as an example, because there is no interception point to it. For what I am wanting to do for a project at the moment this is a critical step for me, and it means that what I want to do will not work because of it.

The multiple entry points isn’t really that big of an issue, as it can be overcome. If you want I can discuss this with you further off list, but I am not in a position to make what I want to do public at the moment.


Andrew Scott