mirror of https://github.com/sunface/rust-course
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sunface
ac69dc1cbd
|
3 years ago | |
---|---|---|
.. | ||
README.md | 3 years ago | |
errors1.rs | 3 years ago | |
errors2.rs | 3 years ago | |
errors3.rs | 3 years ago | |
errors4.rs | 3 years ago | |
errors5.rs | 3 years ago | |
errors6.rs | 3 years ago |
README.md
错误处理
大多数的错误并没有严重到需要让程序完全停止运行的程度。 有时一个函数执行失败时,你可以很容易地对造成失败的原因进行解释并采取对应措施的。 例如,你正试图打开一个文件,但由于该文件不存在导致了操作失败,这时你可能想创建 该文件而不是直接终止程序。