robotparser/model/errors.rs
1use std::fmt;
2
3#[derive(Debug)]
4pub struct Error {
5 pub kind: ErrorKind,
6}
7
8#[derive(Debug)]
9pub enum ErrorKind {
10 Url(url::ParseError),
11 Http(reqwest::Error),
12}
13
14impl fmt::Display for Error {
15 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
16 match self.kind {
17 ErrorKind::Url(ref err) => err.fmt(f),
18 ErrorKind::Http(ref err) => err.fmt(f),
19 }
20 }
21}
22
23impl std::error::Error for Error {}