Skip to content
Snippets Groups Projects

better error handling and internals

Merged STEVAN Antoine requested to merge better-error-handling into main

in this MR

  • all unwraps and expects have been removed from any .rs module that is not main.rs => the goal is to never panic from inside the library and let main.rs handle the errors
  • in main.rs the new throw_error function is used to return a message on stderr and exit the runtime with a code => then komodo.nu picks it up and gives a nicer error to the user
  • the internals of komodo.nu also have been greatly simplified without feature changes

Note
because throw_error does not return anything and some of the places where there might be errors in main.rs need to return a value, some unwrap_or_else need to have an unreachable! statement in them to show the compiler it's ok if there's no value on the Err branch

it would be nice to find a better way of doing this :thinking:

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading