Skip to content

Commit 23e9796

Browse files
Mention std::error::Error isn't strictly required
1 parent a68e7ff commit 23e9796

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/language/exception-handling.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ The equivalent to the .NET `Exception.InnerException` property is the
5454
implementation for `Error::source()`, the blanket (default) implementation
5555
returns a `None`.
5656

57+
> Note: Unlike in C#, in Rust it is not strictly required for an error to implement `std::error::Error`
58+
> (it can be used in `Result` even without that). But it is strongly encouraged, especially for public errors.
59+
5760
## Raising exceptions
5861

5962
To raise an exception in C#, throw an instance of the exception:

0 commit comments

Comments
 (0)