Skip to content

Commit

Permalink
Improve debuggability of Clojure controller errors
Browse files Browse the repository at this point in the history
  • Loading branch information
seancorfield committed Nov 25, 2016
1 parent 4a5e100 commit 0dcc9a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion framework/cljcontroller.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ component {
function onMissingMethod( string missingMethodName, struct missingMethodArguments ) {
if ( structKeyExists( missingMethodArguments, "rc" ) ) {
var rc = missingMethodArguments.rc;
var core = variables.cfmljure.clojure.core;
try {
var rcClj = variables.cfmljure.toClojure( rc );
var rawResult = callClojure( missingMethodName, rcClj );
var result = variables.cfmljure.toCFML( rawResult );
structClear( rc );
structAppend( rc, result );
// post-process special keys in rc for abort / redirect etc
var core = variables.cfmljure.clojure.core;
if ( structKeyExists( rc, "redirect" ) && isStruct( rc.redirect ) &&
structKeyExists( rc.redirect, "action" ) ) {
if ( isObject( variables.fw ) ) {
Expand Down Expand Up @@ -94,6 +94,7 @@ component {
// no such controller method - ignore it
this[ missingMethodName ] = __dummy;
} else {
core.println( "cljcontroller: exception:", e );
throw e;
}
}
Expand Down

0 comments on commit 0dcc9a0

Please sign in to comment.