Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions core/src/wheels/events/onerror/onerrorstart.cfm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<cfif structKeyExists(request.wheels, "exception")>
<cflog
file="wheels-errors"
type="error"
text="#request.wheels.exception.message#
#request.wheels.exception.detail#"
>
</cfif>
16 changes: 14 additions & 2 deletions templates/base/src/public/Application.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,20 @@ component output="false" {
}

public void function onError( any Exception, string EventName ) {
wirebox = new wirebox.system.ioc.Injector("wheels.Wirebox");
application.wo = wirebox.getInstance("global");
try {
wirebox = new wirebox.system.ioc.Injector("wheels.Wirebox");
application.wo = wirebox.getInstance("global");

// Make exception available to the event template
request.wheels = request.wheels ?: {};
request.wheels.exception = Exception;
request.wheels.eventName = EventName;

// Run early error event if it exists
application.wo.$include(template = "/wheels/events/onerror/onerrorstart.cfm");
} catch (any e) {
// Must never break error handling
}

// In case the error was caused by a timeout we have to add extra time for error handling.
// We have to check if onErrorRequestTimeout exists since errors can be triggered before the application.wheels struct has been created.
Expand Down
Loading