better error handling and internals
in this MR
- all
unwraps andexpects have been removed from any.rsmodule that is notmain.rs=> the goal is to never panic from inside the library and letmain.rshandle the errors - in
main.rsthe newthrow_errorfunction is used to return a message onstderrand exit the runtime with a code => thenkomodo.nupicks it up and gives a nicer error to the user - the internals of
komodo.nualso have been greatly simplified without feature changes
Note
becausethrow_errordoes not return anything and some of the places where there might be errors inmain.rsneed to return a value, someunwrap_or_elseneed to have anunreachable!statement in them to show the compiler it's ok if there's no value on theErrbranchit would be nice to find a better way of doing this
🤔