Wirebox constructor errors swallow the whole stack trace

Description

If a component throws an exception during initialization while Wirebox is building it, you get a stack trace like this:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Page: /app/coldbox/system/ioc/Builder.cfc : Line 165 Error: Error building: qGameButton@refs -> can't compare complex object types as simple value. (Builder.BuildCFCDependencyException) CGI Template: /index.cfm User Agent: Mozilla/5.0 (Linux; Android 8.0.0; SAMSUNG-SM-G930A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Mobile Safari/537.36 IP:107.77.228.226 Detail: DSL: , Path: refs.models.qGameButton, Error Location: /app/modules_app/referees/models/qGameButton.cfc:79 /app/coldbox/system/ioc/Builder.cfc : 165 (ID: ??, Type: cfml) /app/coldbox/system/ioc/Injector.cfc : 402 (ID: ??, Type: cfml) /app/coldbox/system/ioc/scopes/NoScope.cfc : 45 (ID: ??, Type: cfml) /app/coldbox/system/ioc/Injector.cfc : 370 (ID: ??, Type: cfml) /app/modules_app/referees/models/RefSchedulerService.cfc : 293 (ID: ??, Type: cfml) /app/modules_app/referees/models/RefSchedulerService.cfc : 320 (ID: ??, Type: cfml) /app/modules_app/referees/models/RefSchedulerService.cfc : 321 (ID: ??, Type: cfml) /app/modules_app/referees/handlers/Scheduler.cfc : 64 (ID: ??, Type: cfml) /app/coldbox/system/web/Controller.cfc : 1040 (ID: ??, Type: cfml) /app/coldbox/system/web/Controller.cfc : 839 (ID: ??, Type: cfml) /app/coldbox/system/web/Controller.cfc : 568 (ID: ??, Type: cfml) /app/coldbox/system/Bootstrap.cfc : 253 (ID: ??, Type: cfml) /app/coldbox/system/Bootstrap.cfc : 472 (ID: ??, Type: cfml) /app/Application.cfc : 208 (ID: ??, Type: cfml)

Only one line in there is useful: the detail line pointing to the actual line number of the error.

I understand that CF doesn't let you nest exceptions and that this situation is not without some good cause, but even so I think it'd be useful to change the behavior here. Every Builder.cfc exception I've seen doesn't tell me anything very useful, except that the error was thrown during the building process – which is certainly useful. But that's one line of useful stuff that I want. The whole rest of the stack trace I can do without.

Is it possible to reverse the behavior here, so that we get the one line of 'by the way, this was Builder.cfc' but the rest of the trace is the actual, underlying error in the component I was trying to build?

Status

Assignee

Brad Wood

Reporter

Samuel W. Knowlton

Labels

None

Fix versions

Priority

Major