Skip to main content
added 143 characters in body
Source Link
Ginger
  • 2.6k
  • 8
  • 45

Aborts/Panics

This is the system Rust uses: There's a "result" type (Result<T>) for recoverable errors, like a malformed URL in a HTTP library, and an "abort" function/macro (panic!) for unrecoverable errors like indexing out of an array. Recoverable errors are returned from functions and can be processed like any other type, but unrecoverable errors crash the program instantly.

Aborts/Panics

This is the system Rust uses: There's a "result" type (Result<T>) for recoverable errors, like a malformed URL in a HTTP library, and an "abort" function/macro (panic!) for unrecoverable errors like indexing out of an array.

Aborts/Panics

This is the system Rust uses: There's a "result" type (Result<T>) for recoverable errors, like a malformed URL in a HTTP library, and an "abort" function/macro (panic!) for unrecoverable errors like indexing out of an array. Recoverable errors are returned from functions and can be processed like any other type, but unrecoverable errors crash the program instantly.

Source Link
Ginger
  • 2.6k
  • 8
  • 45

Aborts/Panics

This is the system Rust uses: There's a "result" type (Result<T>) for recoverable errors, like a malformed URL in a HTTP library, and an "abort" function/macro (panic!) for unrecoverable errors like indexing out of an array.