File
Blob: firmware/vendor/str0m/src/sdp/error.rs
| 1 | use std::error::Error; |
| 2 | use std::fmt; |
| 3 | |
| 4 | /// Errors from parsing and serializing SDP. |
| 5 | #[derive(Debug)] |
| 6 | #[allow(missing_docs)] |
| 7 | pub enum SdpError { |
| 8 | ParseError(String), |
| 9 | Inconsistent(String), |
| 10 | } |
| 11 | |
| 12 | impl fmt::Display for SdpError { |
| 13 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 14 | match self { |
| 15 | SdpError::ParseError(msg) => write!(f, "SDP parse: {}", msg), |
| 16 | SdpError::Inconsistent(msg) => write!(f, "SDP inconsistent: {}", msg), |
| 17 | } |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | impl Error for SdpError {} |