mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-12-29 07:19:17 +00:00
11 lines
666 B
Markdown
11 lines
666 B
Markdown
# 錯誤處理
|
|
|
|
大多數錯誤不會嚴重到需要程式完全停止。有時候,當一個函數發生錯誤時,原因可能很容易理解並能夠應對。例如,如果您嘗試打開一個檔案,但操作失敗是因為該檔案不存在,您可能希望建立該檔案,而不是終止進程。
|
|
|
|
## 進一步了解
|
|
|
|
- [錯誤處理](https://doc.rust-lang.org/book/ch09-02-recoverable-errors-with-result.html)
|
|
- [泛型](https://doc.rust-lang.org/book/ch10-01-syntax.html)
|
|
- [Result](https://doc.rust-lang.org/rust-by-example/error/result.html)
|
|
- [包裝錯誤](https://doc.rust-lang.org/rust-by-example/error/multiple_error_types/boxing_errors.html)
|