G’day
Does ColdBox do something “odd” with its exception handling out of the box? Where “odd” is “do anything with an exception other than simply let it bubble back to ColdFusion”.
Why I ask, is I have this code in one of my handler methods:
throw “exception0”;
var myVar1 = modelObject1.callToMethod();
throw “exception1”;
var myVar2 = getModel(“modelClass2”).callToMethod();
throw “exception2”;
modelObject1.callToDifferentMethod();
throw “exception3”;
And what I get back in the CB exception-handling output is:
Note that it is getting past exceptions 0 & 1, but raising exception 2.
If I change the code slightly to be this:
throw “exception0”;
var myVar1 = modelObject1.callToMethod();
abort;
throw “exception1”;
Then I get nothing on the screen.
If I change it to this:
throw “exception0”;
abort;
var myVar1 = modelObject1.callToMethod();
I then get exception0 being raised.
My config is fairly bog standard, and I have no settings to the effect of “screw with how exceptions are dealt with”. I’ve not got anything to do with exception-handling in there at all, that I can see. This would have me assume there would be no special exception handling being done, and any exceptions beign raised would just… error.
I am 90% certain I am not missing something obvious with my code, and accordingly 90% certain CB is “helping” with something it oughtn’t be “helping” with (given I’ve not asked it to). But am happy to be wrong on this.
Oh: I am in the process of troubleshooting a problem with modelObject1.callToMethod() - I know something is wrong with it - and it’s whilst troubleshooting this I’ve come across this weirdness. However for all intents and purposes the code within the methods will definitely (?) not be contributing to what I am seeing.
I’m guessing it’s something “obvious” in my config I am not aware of (which makes it hard to google answers for… “help with the thing I don’t know what it is”
Cheers for any insight.