[coldbox-3.6.0] Error reporting improvement for groovy loader

I have been doing some groovy loader stuff.
Nothing too complicated, just loading in a script but initially the error reporting didnt work.

In my handler i had
instance.GroovyLoader.runScript(‘scripts/gremlin’,rc.varCollection);

logErrorWithBean in Logger.cfc was failing at

if ( (exception.getType() neq “”) ){
buffer.append(“CFErrorType=” & exception.getType() & chr(13) );
}

as getType() was returning the groovy class, i changed it to

if ( isSimpleValue(exception.getType()) and (exception.getType() neq “”) ){
buffer.append(“CFErrorType=” & exception.getType() & chr(13) );
}

and similarly for BugReport at line 33
from

<cfif Exception.getType() neq “”>
Error Type: #Exception.gettype()# : <cfif Exception.geterrorCode() eq “”>[N/A]#Exception.getErrorCode()#

to

<cfif isSimpleValue(Exception.getType()) and (Exception.getType() neq “”)>
Error Type: #Exception.gettype()# : <cfif Exception.geterrorCode() eq “”>[N/A]#Exception.getErrorCode()#

Now it shows me the error as normal.

Hope this is of use.

Send a pull request

Luis Majano
CEO
Ortus Solutions, Corp
Toll Free/Fax: 1-888-557-8057
Direct: 909-248-3408
www.ortussolutions.com
Twitter: @lmajano, @ortussolutions