|
6 | 6 | // the terms of the Mozilla Public License Version 2.0 as published by the |
7 | 7 | // Mozilla Foundation. See <https://mozilla.org/en-US/MPL/2.0/>. |
8 | 8 |
|
| 9 | +//! Contains our central error enum for easy error propagation. |
| 10 | +//! |
9 | 11 | //! This module contains this crate's error enum. This enum can hold all sorts |
10 | 12 | //! of errors occurring in this crate s.t. error propagation is simple for |
11 | 13 | //! developers of this crate and all sorts of thrown errors and error types can |
12 | 14 | //! be easily found and accessed by developers using this crate. Furthermore, |
13 | 15 | //! the actual errors are wrapped s.t. all information about the error can be |
14 | 16 | //! unwrapped again. |
15 | | -//! |
16 | | -//! **For developers:** |
17 | | -//! - How to add an error to an `enum`? First of all, find a name |
18 | | -//! that is not too specific for your current case s.t. it could be used in other |
19 | | -//! contexts afterwards as well. Then, find the spot according to your chosen error |
20 | | -//! name in a alphanumerically sorted way in the list of supported errors in the doc |
21 | | -//! comment and inside the `enum` itself. |
22 | | -//! Afterwards, add the error to the list of implemented error |
23 | | -//! types in the doc comment of the `enum` with a short description when it is thrown. |
24 | | -//! Probably use this description for the doc comment above the implementation of |
25 | | -//! error in the `enum`. Then, add `#[error(<error msg>)]` to define the error message |
26 | | -//! output once your error is thrown. Below, write down `<error name>(<input>),` to |
27 | | -//! define the error with its name and possibly some inputs. The input can be of the |
28 | | -//! form [`String`], but also another error, whose conversion must be declared via |
29 | | -//! `#[from] OtherError`. It is best to use the existing structure as a guide. For any |
30 | | -//! further information, check out the here used [`thiserror`]-crate. |
| 17 | +
|
| 18 | +// **For developers:** |
| 19 | +// - How to add an error to an `enum`? First of all, find a name |
| 20 | +// that is not too specific for your current case s.t. it could be used in other |
| 21 | +// contexts afterwards as well. Then, find the spot according to your chosen error |
| 22 | +// name in a alphanumerically sorted way in the list of supported errors in the doc |
| 23 | +// comment and inside the `enum` itself. |
| 24 | +// Afterwards, add the error to the list of implemented error |
| 25 | +// types in the doc comment of the `enum` with a short description when it is thrown. |
| 26 | +// Probably use this description for the doc comment above the implementation of |
| 27 | +// error in the `enum`. Then, add `#[error(<error msg>)]` to define the error message |
| 28 | +// output once your error is thrown. Below, write down `<error name>(<input>),` to |
| 29 | +// define the error with its name and possibly some inputs. The input can be of the |
| 30 | +// form [`String`], but also another error, whose conversion must be declared via |
| 31 | +// `#[from] OtherError`. It is best to use the existing structure as a guide. For any |
| 32 | +// further information, check out the here used [`thiserror`]-crate. |
31 | 33 |
|
32 | 34 | use std::ffi::NulError; |
33 | 35 | use thiserror::Error; |
|
0 commit comments