2019-01-11 23:18:34 +00:00
|
|
|
use crate::render::RenderError;
|
2019-07-18 15:42:31 +00:00
|
|
|
use std::fmt::Debug;
|
2019-01-11 23:18:34 +00:00
|
|
|
|
2019-05-17 09:22:32 +00:00
|
|
|
/// Represents any error that may be triggered by Voxygen.
|
2019-01-11 23:18:34 +00:00
|
|
|
#[derive(Debug)]
|
|
|
|
pub enum Error {
|
2019-05-17 09:22:32 +00:00
|
|
|
/// An error relating to the internal client.
|
2019-01-12 15:57:19 +00:00
|
|
|
ClientError(client::Error),
|
2019-05-17 09:22:32 +00:00
|
|
|
/// A miscellaneous error relating to a backend dependency.
|
2019-07-18 15:42:31 +00:00
|
|
|
BackendError(Box<dyn Debug>),
|
2019-05-17 09:22:32 +00:00
|
|
|
/// An error relating the rendering subsystem.
|
2019-01-11 23:18:34 +00:00
|
|
|
RenderError(RenderError),
|
2019-05-17 09:22:32 +00:00
|
|
|
/// A miscellaneous error with an unknown or unspecified source.
|
2019-01-11 23:18:34 +00:00
|
|
|
Other(failure::Error),
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<RenderError> for Error {
|
2020-02-01 20:39:39 +00:00
|
|
|
fn from(err: RenderError) -> Self { Error::RenderError(err) }
|
2019-01-11 23:18:34 +00:00
|
|
|
}
|
2019-01-12 15:57:19 +00:00
|
|
|
|
|
|
|
impl From<client::Error> for Error {
|
2020-02-01 20:39:39 +00:00
|
|
|
fn from(err: client::Error) -> Self { Error::ClientError(err) }
|
2019-01-12 15:57:19 +00:00
|
|
|
}
|