Improve errors while building depenencies

Description

Currently, when WireBox encounters an error while building a dependency, "death by information" occurs. Generally an error message is generated that is so large (often containing entire serialized CFCs and full stack traces) that there is no hope of every being able to decipher it.

Simplify the JSON data for things such as constructor args to not serialize CFCs or large data types. perhaps, just include the name of the datatype for anything other than simple values, and then even truncate those.
Also, don't include the entire stack trace in the message as it is wholly unreadable. Perhaps just pick out the top couple files and line numbers from the tag stack and rely on LogBox to capture the entire "caught" error.

Here is an example of an error. Note, this is JUST the message of the error. I am not including the stack trace.

Application Execution Exception Error Type: Builder.BuildCFCDependencyException : [N/A] Error Messages: Error building: handlers.Main -> Component [handlers.Main] has no accessible Member with name [$wbAOPTargetMapping] enable [trigger data member] in admininistrator to also invoke getters and setters with constructor arguments: {controller={{GETSERVICES={getServices()}, SETCOLDBOXSETTINGS={setColdboxSettings(any coldboxSettings)}, GETLOGBOX={getLogBox()}, GETWIREBOX={getWireBox()}, SETNEXTEVENT={setNextEvent([string event, [string queryString, [boolean addToken, [string persist, [struct persistStruct, [boolean ssl, [string baseURL, [boolean postProcessExempt, [string URL, [string URI, [numeric statusCode]]]]]]]]]]])}, GETCOLDBOXSETTINGS={getColdboxSettings()}, GETCOLDBOXOCM={getColdboxOCM([any cacheName])}, GETREQUESTSERVICE={getRequestService()}, SETCONFIGSETTINGS={setConfigSettings(any configSettings)}, SETCACHEBOX={setCacheBox(any cacheBox)}, SETSETTING={setSetting([any name, [any value]])}, GETAPPROOTPATH={getAppRootPath()}, SETCOLDBOXOCM={setColdboxOCM(any coldboxOCM)}, SETPLUGINSERVICE={setPluginService(Any pluginService)}, GETHANDLERSERVICE={getHandlerService()}, SETVALIDATIONMANAGER={setValidationManager(any validationManager)}, GETVALIDATIONMANAGER={getValidationManager()}, SETDEBUGGERSERVICE={setDebuggerService(any debuggerService)}, SETWIREBOX={setWireBox(any wireBox)}, GETSETTINGSTRUCTURE={getSettingStructure([any FWSetting, [any deepCopyFlag]])}, GETMODULESERVICE={getModuleService()}, GETCOLDBOXINITIATED={getColdboxInitiated()}, GETAPPHASH={getAppHash()}, SETTINGEXISTS={settingExists(any name, [any FWSetting])}, SETLOADERSERVICE={setLoaderService(any loaderService)}, SETREQUESTSERVICE={setRequestService(any requestService)}, GETPLUGIN={getPlugin(any plugin, [any customPlugin, [any newInstance, [any module, [any init]]]])}, GETMEMENTO={getMemento()}, GETCACHEBOX={getCacheBox()}, GETASPECTSINITIATED={getAspectsInitiated()}, SETHANDLERSERVICE={setHandlerService(any handlerService)}, SETCOLDBOXINITIATED={setColdboxInitiated(any coldboxInitiated)}, GETLOADERSERVICE={getLoaderService()}, SETLOGBOX={setLogBox(any logBox)}, GETSETTING={getSetting([any name, [any FWSetting, [any defaultValue]]])}, GETPLUGINSERVICE={getPluginService()}, GETINTERCEPTORSERVICE={getInterceptorService()}, GETCONFIGSETTINGS={getConfigSettings()}, SETMODULESERVICE={setModuleService(any moduleService)}, SETLOG={setLog(any logger)}, GETAPPKEY={getAppKey()}, SETASPECTSINITIATED={setAspectsInitiated(any aspectsInitiated)}, SETINTERCEPTORSERVICE={setInterceptorService(any interceptorService)}, SETAPPROOTPATH={setAppRootPath(any appRootPath)}, INIT={init(any appRootPath, any appKey)}, SETAPPHASH={setAppHash(any appHash)}, GETEXCEPTIONSERVICE={getExceptionService()}, GETCFMLENGINE={getCFMLEngine()}, RUNEVENT={runEvent([any event, [any prepostExempt, [any private, [any default, [any eventArguments]]]]])}, PERSISTVARIABLES={persistVariables([any persist, [any persistStruct]])}, GETDEBUGGERSERVICE={getDebuggerService()}}}} Mapping: {metadata={{inheritancetrail={[handlers.Main, railo-context.Component]}, hint={This is the Base Component}, remoteAddress={http://scribble.dev:8080/handlers/Main.cfc?wsdl}, path={C:\Users\Brad.development\Documents\GitHub\WireBox_AOP_Method_Logger\handlers\Main.cfc}, displayname={Component}, synchronized={false}, fullname={handlers.Main}, properties={[{inject={HelloWorldService}, name={HelloWorldService}, type={any}}]}, name={handlers.Main}, accessors={false}, type={component}, persistent={false}, functions={[{access={public}, returnFormat={wddx}, returntype={any}, output={true}, closure={false}, parameters={[{required={false}, name={event}, type={any}}, {required={false}, name={rc}, type={any}}, {required={false}, name={prc}, type={any}}]}, name={index}, owner={C:\Users\Brad.development\Documents\GitHub\WireBox_AOP_Method_Logger\handlers\Main.cfc}, description={}}]}, hashCode={1224513081}}}, mixins={[]}, autoAspectBinding={true}, cache={{provider={default}, key={handlers-handlers.Main}, lastAccessTimeout={}, timeout={}}}, constructor={init}, DIProperties={[{ref={null}, required={true}, argName={}, dsl={HelloWorldService}, javaCast={null}, name={HelloWorldService}, value={null}, scope={variables}}]}, onDIComplete={[]}, name={handlers.Main}, scope={NoScope}, value={}, extraAttributes={{isHandler={true}, handlerPath={handlers.Main}}}, method={}, autoWire={true}, providerMethods={[]}, DIMethodArgs={[]}, threadSafe={true}, alias={[]}, autoInit={true}, path={handlers.Main}, virtualInheritance={coldbox.system.EventHandler}, eagerInit={false}, dsl={}, DISetters={[]}, type={cfc}, DIConstructorArgs={[{ref={null}, required={true}, argName={}, dsl={null}, javaCast={null}, name={controller}, value={{GETSERVICES={getServices()}, SETCOLDBOXSETTINGS={setColdboxSettings(any coldboxSettings)}, GETLOGBOX={getLogBox()}, GETWIREBOX={getWireBox()}, SETNEXTEVENT={setNextEvent([string event, [string queryString, [boolean addToken, [string persist, [struct persistStruct, [boolean ssl, [string baseURL, [boolean postProcessExempt, [string URL, [string URI, [numeric statusCode]]]]]]]]]]])}, GETCOLDBOXSETTINGS={getColdboxSettings()}, GETCOLDBOXOCM={getColdboxOCM([any cacheName])}, GETREQUESTSERVICE={getRequestService()}, SETCONFIGSETTINGS={setConfigSettings(any configSettings)}, SETCACHEBOX={setCacheBox(any cacheBox)}, SETSETTING={setSetting([any name, [any value]])}, GETAPPROOTPATH={getAppRootPath()}, SETCOLDBOXOCM={setColdboxOCM(any coldboxOCM)}, SETPLUGINSERVICE={setPluginService(Any pluginService)}, GETHANDLERSERVICE={getHandlerService()}, SETVALIDATIONMANAGER={setValidationManager(any validationManager)}, GETVALIDATIONMANAGER={getValidationManager()}, SETDEBUGGERSERVICE={setDebuggerService(any debuggerService)}, SETWIREBOX={setWireBox(any wireBox)}, GETSETTINGSTRUCTURE={getSettingStructure([any FWSetting, [any deepCopyFlag]])}, GETMODULESERVICE={getModuleService()}, GETCOLDBOXINITIATED={getColdboxInitiated()}, GETAPPHASH={getAppHash()}, SETTINGEXISTS={settingExists(any name, [any FWSetting])}, SETLOADERSERVICE={setLoaderService(any loaderService)}, SETREQUESTSERVICE={setRequestService(any requestService)}, GETPLUGIN={getPlugin(any plugin, [any customPlugin, [any newInstance, [any module, [any init]]]])}, GETMEMENTO={getMemento()}, GETCACHEBOX={getCacheBox()}, GETASPECTSINITIATED={getAspectsInitiated()}, SETHANDLERSERVICE={setHandlerService(any handlerService)}, SETCOLDBOXINITIATED={setColdboxInitiated(any coldboxInitiated)}, GETLOADERSERVICE={getLoaderService()}, SETLOGBOX={setLogBox(any logBox)}, GETSETTING={getSetting([any name, [any FWSetting, [any defaultValue]]])}, GETPLUGINSERVICE={getPluginService()}, GETINTERCEPTORSERVICE={getInterceptorService()}, GETCONFIGSETTINGS={getConfigSettings()}, SETMODULESERVICE={setModuleService(any moduleService)}, SETLOG={setLog(any logger)}, GETAPPKEY={getAppKey()}, SETASPECTSINITIATED={setAspectsInitiated(any aspectsInitiated)}, SETINTERCEPTORSERVICE={setInterceptorService(any interceptorService)}, SETAPPROOTPATH={setAppRootPath(any appRootPath)}, INIT={init(any appRootPath, any appKey)}, SETAPPHASH={setAppHash(any appHash)}, GETEXCEPTIONSERVICE={getExceptionService()}, GETCFMLENGINE={getCFMLEngine()}, RUNEVENT={runEvent([any event, [any prepostExempt, [any private, [any default, [any eventArguments]]]]])}, PERSISTVARIABLES={persistVariables([any persist, [any persistStruct]])}, GETDEBUGGERSERVICE={getDebuggerService()}}}, scope={variables}}]}, discovered={true}, aspect={false}}, Stacktrace: Component [handlers.Main] has no accessible Member with name [$wbAOPTargetMapping] at railo.runtime.ComponentImpl.get(ComponentImpl.java:1607):1607 at railo.runtime.util.VariableUtilImpl.get(VariableUtilImpl.java:235):235 at railo.runtime.PageContextImpl.get(PageContextImpl.java:1385):1385 at system.aop.tmp._3bd7ab5e_25a6_44ef_be18_6b3824b1f5e0_cfm2970$cf.udfCall(/coldbox/system/aop/tmp/3bd7ab5e-25a6-44ef-be18-6b3824b1f5e0.cfm:11):11 at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:93):93 at railo.runtime.type.UDFImpl._call(UDFImpl.java:307):307 at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:195):195 at railo.runtime.ComponentImpl._call(ComponentImpl.java:625):625 at railo.runtime.ComponentImpl._call(ComponentImpl.java:507):507 at railo.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1748):1748 at railo.runtime.tag.Invoke.doComponent(Invoke.java:203):203 at railo.runtime.tag.Invoke.doEndTag(Invoke.java:176):176 at system.ioc.builder_cfc$cf.udfCall1(/coldbox/system/ioc/Builder.cfc:118):118 at system.ioc.builder_cfc$cf.udfCall(/coldbox/system/ioc/Builder.cfc):-1 at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:93):93 at railo.runtime.type.UDFImpl._call(UDFImpl.java:307):307 at railo.runtime.type.UDFImpl.call(UDFImpl.java:208):208 at railo.runtime.ComponentImpl._call(ComponentImpl.java:624):624 at railo.runtime.ComponentImpl._call(ComponentImpl.java:507):507 at railo.runtime.ComponentImpl.call(ComponentImpl.java:1735):1735 at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:722):722 at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1531):1531 at system.ioc.injector_cfc$cf.udfCall1(/coldbox/system/ioc/Injector.cfc:288):288 at system.ioc.injector_cfc$cf.udfCall(/coldbox/system/ioc/Injector.cfc):-1 at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:93):93 at railo.runtime.type.UDFImpl._call(UDFImpl.java:307):307 at railo.runtime.type.UDFImpl.call(UDFImpl.java:208):208 at railo.runtime.ComponentImpl._call(ComponentImpl.java:624):624 at railo.runtime.ComponentImpl._call(ComponentImpl.java:507):507 at railo.runtime.ComponentImpl.call(ComponentImpl.java:1735):1735 at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:722):722 at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1531):1531 at system.ioc.scopes.noscope_cfc$cf.udfCall(/coldbox/system/ioc/scopes/NoScope.cfc:31):31 at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:93):93 at railo.runtime.type.UDFImpl._call(UDFImpl.java:307):307 at railo.runtime.type.UDFImpl.call(UDFImpl.java:208):208 at railo.runtime.ComponentImpl._call(ComponentImpl.java:624):624 at railo.runtime.ComponentImpl._call(ComponentImpl.java:507):507 at railo.runtime.ComponentImpl.call(ComponentImpl.java:1735):1735 at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:722):722 at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1531):1531 at system.ioc.injector_cfc$cf.udfCall1(/coldbox/system/ioc/Injector.cfc:261):261 at system.ioc.injector_cfc$cf.udfCall(/coldbox/system/ioc/Injector.cfc):-1 at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:93):93 at railo.runtime.type.UDFImpl._call(UDFImpl.java:307):307 at railo.runtime.type.UDFImpl.call(UDFImpl.java:208):208 at railo.runtime.ComponentImpl._call(ComponentImpl.java:624):624 at railo.runtime.ComponentImpl._call(ComponentImpl.java:507):507 at railo.runtime.ComponentImpl.call(ComponentImpl.java:1735):1735 at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:722):722 at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1531):1531 at system.web.services.handlerservice_cfc$cf.udfCall1(/coldbox/system/web/services/HandlerService.cfc:120):120 at system.web.services.handlerservice_cfc$cf.udfCall(/coldbox/system/web/services/HandlerService.cfc):-1 at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:93):93 at railo.runtime.type.UDFImpl._call(UDFImpl.java:307):307 at railo.runtime.type.UDFImpl.call(UDFImpl.java:208):208 at railo.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:704):704 at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:722):722 at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1531):1531 at system.web.services.handlerservice_cfc$cf.udfCall1(/coldbox/system/web/services/HandlerService.cfc:141):141 at system.web.services.handlerservice_cfc$cf.udfCall(/coldbox/system/web/services/HandlerService.cfc):-1 at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:93):93 at railo.runtime.type.UDFImpl._call(UDFImpl.java:307):307 at railo.runtime.type.UDFImpl.call(UDFImpl.java:208):208 at railo.runtime.ComponentImpl._call(ComponentImpl.java:624):624 at railo.runtime.ComponentImpl._call(ComponentImpl.java:507):507 at railo.runtime.ComponentImpl.call(ComponentImpl.java:1735):1735 at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:722):722 at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1531):1531 at system.web.controller_cfc$cf.udfCall5(/coldbox/system/web/Controller.cfc:550):550 at system.web.controller_cfc$cf.udfCall(/coldbox/system/web/Controller.cfc):-1 at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:93):93 at railo.runtime.type.UDFImpl._call(UDFImpl.java:307):307 at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:195):195 at railo.runtime.ComponentImpl._call(ComponentImpl.java:625):625 at railo.runtime.ComponentImpl._call(ComponentImpl.java:507):507 at railo.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1752):1752 at railo.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:748):748 at railo.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1541):1541 at coldbox.system.coldbox_cfc$cf.udfCall1(/coldbox/system/Coldbox.cfc:236):236 at coldbox.system.coldbox_cfc$cf.udfCall(/coldbox/system/Coldbox.cfc):-1 at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:93):93 at railo.runtime.type.UDFImpl._call(UDFImpl.java:307):307 at railo.runtime.type.UDFImpl.call(UDFImpl.java:208):208 at railo.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:704):704 at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:722):722 at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1531):1531 at coldbox.system.coldbox_cfc$cf.udfCall1(/coldbox/system/Coldbox.cfc:382):382 at coldbox.system.coldbox_cfc$cf.udfCall(/coldbox/system/Coldbox.cfc):-1 at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:93):93 at railo.runtime.type.UDFImpl._call(UDFImpl.java:307):307 at railo.runtime.type.UDFImpl.call(UDFImpl.java:208):208 at railo.runtime.ComponentImpl._call(ComponentImpl.java:624):624 at railo.runtime.ComponentImpl._call(ComponentImpl.java:507):507 at railo.runtime.ComponentImpl.call(ComponentImpl.java:1735):1735 at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:722):722 at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1531):1531 at application_cfc$cf.udfCall(/Application.cfc:38):38 at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:93):93 at railo.runtime.type.UDFImpl._call(UDFImpl.java:307):307 at railo.runtime.type.UDFImpl.call(UDFImpl.java:208):208 at railo.runtime.ComponentImpl._call(ComponentImpl.java:624):624 at railo.runtime.ComponentImpl._call(ComponentImpl.java:507):507 at railo.runtime.ComponentImpl.call(ComponentImpl.java:1735):1735 at railo.runtime.listener.ModernAppListener.call(ModernAppListener.java:390):390 at railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:116):116 at railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:18):18 at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2195):2195 at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2162):2162 at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:332):332 at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:29):29 at javax.servlet.http.HttpServlet.service(HttpServlet.java:728):728 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305):305 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210):210 at com.seefusion.Filter.doFilter(Filter.java:49):49 at com.seefusion.SeeFusion.doFilter(SeeFusion.java:1500):1500 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243):243 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210):210 at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source):-1 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43):43 at java.lang.reflect.Method.invoke(Method.java:601):601 at com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:96):96 at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doNext(FusionReactorRequestHandler.java:346):346 at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doHttpServletRequest(FusionReactorRequestHandler.java:224):224 at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doFusionRequest(FusionReactorRequestHandler.java:153):153 at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.handle(FusionReactorRequestHandler.java:381):381 at com.intergral.fusionreactor.j2ee.filter.FusionReactorCoreFilter.doFilter(FusionReactorCoreFilter.java:36):36 at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source):-1 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43):43 at java.lang.reflect.Method.invoke(Method.java:601):601 at com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:78):78 at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown Source):-1 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43):43 at java.lang.reflect.Method.invoke(Method.java:601):601 at com.intergral.fusionreactor.agent.filter.FusionReactorStaticFilter.doFilter(FusionReactorStaticFilter.java:53):53 at com.intergral.fusionreactor.agent.pointcuts.NewFilterChainPointCut$1.invoke(NewFilterChainPointCut.java:41):41 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java):-1 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222):222 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123):123 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472):472 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171):171 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99):99 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118):118 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408):408 at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009):1009 at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589):589 at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852):1852 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145):1145 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615):615 at java.lang.Thread.run(Thread.java:722):722

Gliffy Diagrams

Activity

Show:

Dominic WatsonAugust 7, 2014 at 2:35 PM

For me its the other way around, debugging is impossible because the actual point where the error is thrown is masked. I know that happened somewhere during the init of service-x, but that's it.

Without catching it, I can get straight to the problematic code by looking at the tag context.

You lose the part about "Wirebox had a problem initing model X", but you gain getting straight to the point of the error which is the most important part imo.

Brad WoodAugust 7, 2014 at 2:29 PM

the problem with not try/catching the error is that it makes debugging impossible. For instance, this text at the beginning of the error "Error building: handlers.Main" would be impossible to know. Let's say you have a site with 200 models and somewhere, one of them had an error building one of their dependencies. You would have no idea at all where the problem existed because the original stack trace is just buried somewhere inside of WireBox and the tag stack can be very, very, very long depending on how nested your dependencies are. Our first pass at this was to just enable debug logging, but all that did was dump thousands of lines of info into a log file that was almost impossible to sift through.

What would be REALLY nice is if ColdFusion let us throw exceptions with a "cause" like Java works. But in the mean time, rethrowing the error is the only way to have a hope of debugging it, but we just need to simplify the amount of crap we're putting in there.

Dominic WatsonAugust 7, 2014 at 8:00 AM
Edited

My vote here is for Wirebox NOT to catch and rethrow any errors at all. The issue with catching the error and throwing it again is that the TagContext gets foreshortened, losing vital information.

I would like the try and catch to be removed from /ioc/Builder.cfc:

<cftry> <!--- Invoke constructor ---> <cfinvoke component="#oModel#" method="#thisMap.getConstructor()#" argumentcollection="#constructorArgs#"> <cfcatch type="any"> <!--- Controlled Exception ---> <cfthrow message="Error building: #thisMap.getName()# -> #cfcatch.message# #cfcatch.detail# with constructor arguments: #constructorArgs.toString()#" detail="Mapping: #thisMap.getMemento().toString()#, Stacktrace: #cfcatch.stacktrace#" type="Builder.BuildCFCDependencyException"> </cfcatch> </cftry>

Becomes:

<cfinvoke component="#oModel#" method="#thisMap.getConstructor()#" argumentcollection="#constructorArgs#">
Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Fix versions

Priority

Sentry

Created February 26, 2014 at 9:47 AM
Updated August 8, 2017 at 3:42 PM
Resolved August 8, 2017 at 3:42 PM