ABSTRACT

In this chapter, the author covers error handling, where he discusses unrecoverable errors with panic and recoverable errors with result. Rust's dedication to dependability goes to error handling as well. This criterion improves the robustness of program by guaranteeing that mistakes are discovered and handled effectively before our code is pushed to production. The majority of errors aren't substantial enough to cause the software to shut down completely. When a function fails, it may be for a reason that is simple to understand and respond to. To avoid crashing the software, use a default username or search for the username from somewhere other than a file.