File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
vendor/wheels/events/onerror Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -261,8 +261,20 @@ component output="false" {
261261 }
262262
263263 public void function onError ( any Exception , string EventName ) {
264- injector = new wheels .Injector (" wheels.Bindings" );
265- application .wo = injector .getInstance (" global" );
264+ try {
265+ injector = new wheels .Injector (" wheels.Bindings" );
266+ application .wo = injector .getInstance (" global" );
267+
268+ // Make exception available to the event template
269+ request .wheels = request .wheels ?: {};
270+ request .wheels .exception = Exception ;
271+ request .wheels .eventName = EventName ;
272+
273+ // Run early error event if it exists
274+ application .wo .$include (template = " /wheels/events/onerror/onerrorstart.cfm" );
275+ } catch (any e ) {
276+ // Must never break error handling
277+ }
266278
267279 // In case the error was caused by a timeout we have to add extra time for error handling.
268280 // We have to check if onErrorRequestTimeout exists since errors can be triggered before the application.wheels struct has been created.
Original file line number Diff line number Diff line change 1+ <cfif structKeyExists (request .wheels , " exception" ) >
2+ <cflog
3+ file =" wheels-errors"
4+ type =" error"
5+ text =" #request .wheels .exception .message #
6+ #request .wheels .exception .detail #"
7+ >
8+ </cfif >
You can’t perform that action at this time.
0 commit comments