- NxScript version: github latest
- Haxe version: ?.?.?
- Branch: main
- Using DCE: not related
- Affected targets: all
Checklist
What is this related to?
Code snippet reproducing the issue
try {
// .. code
} catch (e: Error) { }
Observed behavior
You cannot specify a type hint for e, which causes it to be unrecognized
Additionally, exceptions thrown from external Haxe function calls inside a try/catch are not properly caught by the script runtime.
Example cases include:
- Calling native Haxe functions inside a
try
CALL_METHOD execution paths
In these situations, the exception escapes the script try/catch block and crashes instead of being handled by the script.
This appears to happen because errors thrown outside script-defined functions are not wrapped or forwarded back into the script exception handler.
Expected behavior
Work lol
Logs / Console output / Screenshots
Prefer text logs over screenshots. Use code blocks for console output. Attach a file if the output is too large.
Additional information (optional)
Anything that may not be directly related to NxScript: shadowclasses, specific targets, macros, external libraries, unusual setup, etc.
NxScript implementation details (optional)
Only if your setup is unusual.
Checklist
What is this related to?
Code snippet reproducing the issue
Observed behavior
You cannot specify a type hint for
e, which causes it to be unrecognizedAdditionally, exceptions thrown from external Haxe function calls inside a
try/catchare not properly caught by the script runtime.Example cases include:
tryCALL_METHODexecution pathsIn these situations, the exception escapes the script
try/catchblock and crashes instead of being handled by the script.This appears to happen because errors thrown outside script-defined functions are not wrapped or forwarded back into the script exception handler.
Expected behavior
Work lol
Logs / Console output / Screenshots
Additional information (optional)
NxScript implementation details (optional)
// optional code