You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>fibjs crash-exitcode.js
crash-exitcode.js:1:1
a.b = 'Crash!';
^
ReferenceError: a is not defined
at crash-exitcode.js:1:1
>echo %errorlevel%
0
Node test result
>node crash-exitcode.js
crash-exitcode.js:1
a.b = 'Crash!';
^
ReferenceError: a is not defined
at Object.<anonymous> (crash-exitcode.js:1:1)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49
Node.js v20.10.0
>echo %errorlevel%
1
The text was updated successfully, but these errors were encountered:
There is a design difference in the details here. In Node.js, any uncaught errors will immediately exit the process; but in FibJS, only errors from the main fiber will exit the process, while errors in other fibers are considered non-serious errors and do not exit the process.
I can change the strategy to exit with code 1 when the main fiber encounters an error(52daaef), but this behavior still differs from Node.js, because there might be errors reported by other fibers while the main fiber exits normally. In that case, should the exit code be 0 or 1? This may need further discussion.
Versions
Fibjs v0.37.0, windows 10 x64.
Test source code
Expected test result
The process exit code is 1.
Fibjs test result
Node test result
The text was updated successfully, but these errors were encountered: