Status/Resolution/Reason: Needs Review//
Reporter/Name(from Bugbase): Alexandre Potvin Latreille / Alexandre Potvin Latreille (Alexandre Potvin Latreille)
Created: 10/26/2015
Components: Core Runtime
Versions: 11.0
Failure Type: Enhancement Request
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Major / All users will encounter
Locale/System: ALL / Win 2008 Server R2
Vote Count: 1
Problem Description:
throw/cfthrow doesn't support the ability to specify an exception cause. Being able to specify which low-level exception caused the high-level exception is very useful in order to avoid swallowing important error details when throwing a custom exception in response to another exception.
Steps to Reproduce: -
Actual Result: -
Expected Result:
We should be able to pass a "cause" argument to throw/cfthrow which would accept a java.lang.Throwable.
Any Workarounds:
We can directly instanciate a coldfusion.runtime.CustomException and call the initCause method.
<cftry>
<cfthrow type="LowLevel" message="Low-level exception">
<cfcatch type="any">
<cfset highLevelEx = createObject('java', 'coldfusion.runtime.CustomException').init('HighLevel', 'message', 'detail', 'errorCode', 'extendedInfo')>
<cfset highLevelEx.initCause(cfcatch)>
<cfthrow object="#highLevelEx#">
</cfcatch>
</cftry>
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4079303
External Customer Info:
External Company:
External Customer Name: Alexandre Potvin Latreille
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: