Open gikf opened 1 year ago
I have looked into this quite a bit.
My issue is everything is wrapped in a try...catch
. So, how any error can result in the server crashing, I cannot fathom.
I think I tracked the place where it's uncaught to the sayHello
call in the code, which is then eval
ed.
https://github.com/freeCodeCamp/solana-curriculum/blob/ddbe1d90580c4ee14b08b30806faadbe93c313bc/curriculum/locales/english/learn-how-to-interact-with-on-chain-programs.md?plain=1#L5396
Chaining .catch
to it, stops the crash, and the exact TypeError
is caught there. Or changing eval
ed function to async and awaiting both for sayHello
and eval
.
Right, but the code that runs that block is within a try...catch
:
In fact, it is within multiple try...catch
blocks
I don't understand why exactly that's happening. Every time I encounter error handling in nested asynchronous function I feel I'm getting deeper and deeper into confusion. It almost appears as if when it's not caught at the nearest/first possible place then it ends up in some limbo.
Issue/Experience
During the run of tests on steps 43 and 44, server crashes if code has errors.
I had missing correct object creation when initially tried to run tests on step 43. This resulted in a crash:
Terminal output is included below.
The same error doesn't create issues elsewhere, I've tried in step 35 making similar error and there were no crashes. It's not specific for only that error, crash happens also ie. on
ReferenceError
. Similar situation is with step 44.Output of running
node tooling/camper-info.js
from the workspace root🔵 INFO: Project: learn-how-to-interact-with-on-chain-programs 🔵 INFO: Lesson Number: 1 🔵 INFO: Curriculum Version: 0.1.2 🔵 INFO: freeCodeCamp - Courses: freeCodeCamp.freecodecamp-courses@1.7.1 🔵 INFO: Commit: 5526f1a chore(deps): update dependency @types/node to v18.11.13
🔵 INFO: OS Info: Architecture: x64 Platform: linux Release: 5.15.0-56-generic Type: Linux