diff options
author | Alex Crichton <alex@alexcrichton.com> | 2016-03-07 23:48:01 -0800 |
---|---|---|
committer | Alex Crichton <alex@alexcrichton.com> | 2016-03-07 23:48:01 -0800 |
commit | d02e62233088df15fd43b86aa97e0695b375a46b (patch) | |
tree | 2916720381cd7f8448031fe4ffd83d3452dfc8bb /src/decoder/mod.rs | |
parent | 77be56048c57614fd0f0a2e80c089861d68aadc3 (diff) | |
download | milf-rs-d02e62233088df15fd43b86aa97e0695b375a46b.tar.gz milf-rs-d02e62233088df15fd43b86aa97e0695b375a46b.zip |
WIP
Diffstat (limited to 'src/decoder/mod.rs')
-rw-r--r-- | src/decoder/mod.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/decoder/mod.rs b/src/decoder/mod.rs index 7c444e0..6180c13 100644 --- a/src/decoder/mod.rs +++ b/src/decoder/mod.rs @@ -53,6 +53,8 @@ pub enum DecodeErrorKind { NilTooLong, /// There was an error with the syntactical structure of the TOML. SyntaxError, + /// A custom error was generated when decoding. + CustomError(String), /// The end of the TOML input was reached too soon EndOfStream, } @@ -195,6 +197,9 @@ impl fmt::Display for DecodeError { EndOfStream => { write!(f, "end of stream") } + CustomError(ref s) => { + write!(f, "custom error: {}", s) + } }); match self.field { Some(ref s) => { @@ -218,6 +223,7 @@ impl error::Error for DecodeError { NilTooLong => "nonzero length string representing nil", SyntaxError => "syntax error", EndOfStream => "end of stream", + CustomError(..) => "custom error", } } } |