Been writing typescript in Vue3 for about 5 months. Been a long time BEAMer writing Erlang, Elixir, LFE etc for over 20 years now and really BEAM-brained and this has given me a huge blind spot which I have just stumbled on with regard to errors.
So in the BEAM you just crash on error "Let it crash" and all crashes/errors are logged and every process is part of a supervision process that knows how to restart it and, and, and crashing is normal, you write fragile code (like after 7 years of writing Erlang full time I checked and had written 7 try/catches for managing external inputs). Crash, crash, crash your code will let you know, programme the happy path and only the happy path...
So blah-blah, writing typescript and I just discovered that this code path that is run every 5 minutes calls a function that JUST DOESN'T EXIST. (Its to do with JWT expiry, so the behavior was low level nagging but not terminal for the last few months, and I thought it was something else).
So my questions are:
- what happens to errors in Typescript? Why don't I see them in DevTools?
- what is the best practice for catching and logging them? Try/Catch everywhere?