MethodSecurity Exception

HI all,

Just wondering if someone can point me in the right direction here. If I enable handler method security like so:

// HTTP Security
this.allowedMethods = {getUser=‘GET’,createUser=‘POST’,updateUser=‘PUT’};

…and someone tries to run a POST on a getUser, at what point in the framework does this exception occur? Ideally I’m wondering where to put my logging code to track that an exception has occurred. Would this be in Main.onException?

Thanks.

Nolan

Nolan, this ocurrs when the event is in the runEvent() cycle. So you can either do an implicit onError() method in the same handler and that will trap it, or rely on the bubble and trap it at the exception handler or interceptor level
Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Hi Luis,

Thanks for your email. All of my handlers extend a BaseHandler which contains an onError however this method doesn’t seem to get called with MethodSecurity exceptions for some reason. I didn’t think of handling this in an interceptor. I know how to handle detecting the current Route/Event, but what methods would I call to determine the allowedMethods? Is there something like event.getCurrentEvent.getAllowedMethods()?

Thanks.

Nolan