feat: added cleanscript

This commit is contained in:
2026-06-22 21:27:36 +05:30
parent dbddc0ce2d
commit 4581eea409
309 changed files with 14551 additions and 46035 deletions

View File

@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Error Handling</title>
</head>
<body>
<h1 id="error-handling"><a class="header" href="#error-handling">Error Handling</a></h1>
<p>Errors are a fact of life in software, so Rust has a number of features for
handling situations in which something goes wrong. In many cases, Rust requires
you to acknowledge the possibility of an error and take some action before your
code will compile. This requirement makes your program more robust by ensuring
that youll discover errors and handle them appropriately before deploying your
code to production!</p>
<p>Rust groups errors into two major categories: recoverable and unrecoverable
errors. For a <em>recoverable error</em>, such as a <em>file not found</em> error, we most
likely just want to report the problem to the user and retry the operation.
<em>Unrecoverable errors</em> are always symptoms of bugs, such as trying to access a
location beyond the end of an array, and so we want to immediately stop the
program.</p>
<p>Most languages dont distinguish between these two kinds of errors and handle
both in the same way, using mechanisms such as exceptions. Rust doesnt have
exceptions. Instead, it has the type <code>Result&lt;T, E&gt;</code> for recoverable errors and
the <code>panic!</code> macro that stops execution when the program encounters an
unrecoverable error. This chapter covers calling <code>panic!</code> first and then talks
about returning <code>Result&lt;T, E&gt;</code> values. Additionally, well explore
considerations when deciding whether to try to recover from an error or to stop
execution.</p>
</body>
</html>