Add necessary error variant

master
Paul Woolcock 6 years ago
parent e7afdf7b59
commit 3f7841da02
  1. 3
      src/errors.rs
  2. 1
      src/lib.rs

@ -37,6 +37,8 @@ pub enum Error {
Client(StatusCode), Client(StatusCode),
/// Generic server error. /// Generic server error.
Server(StatusCode), Server(StatusCode),
/// MastodonBuilder error.
DataMissing,
} }
impl fmt::Display for Error { impl fmt::Display for Error {
@ -63,6 +65,7 @@ impl error::Error for Error {
Error::ClientIdRequired => "ClientIdRequired", Error::ClientIdRequired => "ClientIdRequired",
Error::ClientSecretRequired => "ClientSecretRequired", Error::ClientSecretRequired => "ClientSecretRequired",
Error::AccessTokenRequired => "AccessTokenRequired", Error::AccessTokenRequired => "AccessTokenRequired",
Error::DataMissing => "DataMissing",
} }
} }
} }

@ -438,6 +438,7 @@ impl MastodonBuilder {
} }
} }
#[allow(dead_code)]
pub fn client(&mut self, client: Client) -> &mut Self { pub fn client(&mut self, client: Client) -> &mut Self {
self.client = Some(client); self.client = Some(client);
self self

Loading…
Cancel
Save