Title:
Using throw() with parentheses and colons inside the message text causes Coldfusion to make a new exception TagContext entry with part of the string inside the parentheses labeled as the "template"
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/Fixed
Reporter/Name(from Bugbase): Michael Neth / Michael Neth ()
Created: 06/14/2017
Components: Language, Exception Handling
Versions: 2016,11.0
Failure Type: Incorrectly functioning
Found In Build/Fixed In Build: Coldfusion 11 update 11 / CF14
Priority/Frequency: Trivial / Few users will encounter
Locale/System: English / Linux CentOS 6.4
Vote Count: 1
Problem Description:
Using throw() with parentheses and colons inside the message text causes Coldfusion to make a new exception TagContext entry with part of the string inside the parentheses labeled as the "template". This is unexpected behavior and causes problems with things like exception tracking software that will attempt to read the template files to get code lines around exceptions.
Steps to Reproduce:
1. Make a new file named cf-throw-problem.cfm
2. Add the following code:
<cfscript>
try {
throw("This is a test message with parentheses and a string with colons inside of it - for example a time stamp. (12:34:56)");
} catch (any e) {
writedump(e);
}
</cfscript>
3. Run the file
Actual Result:
The exception tagContext array includes a new element with "raw_trace" equal to "coldfusion.runtime.CustomException: This is a test message with parentheses and a special string inside of it (12:34:56)" and "template" equal to "12:34".
Expected Result:
A tagContext array that does not include the extra element described above. Instead, the first element will have "raw_trace" equal to something like "at cfcf2dthrow2dproblem2ecfm<numbers>.runPage(/<file path>/cf-throw-problem.cfm:3)" and "template" equal to "/<file path>/cf-throw-problem.cfm"
Any Workarounds:
The only workaround is to remove the parentheses.
Attachments:
Comments: