Created
November 26, 2025 17:33
-
-
Save trycf/113312755c4a7d0ac0b122cae158f6ef to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cfscript> | |
| function foo(forceError = false) { | |
| try { | |
| if (forceError) { | |
| throw('Oopsie! An Error') | |
| } | |
| return [{a: 'test'}, {}] | |
| } catch(any e) { | |
| return [{}, e] | |
| } | |
| } | |
| [data, error] = foo(true) | |
| if (!structIsEmpty(error)) { | |
| writeDump('oh no! an error in success!') | |
| } | |
| writeDump({ data, error }) | |
| </cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment