veloren/voxygen/src/error.rs
2019-07-02 21:29:38 +00:00

29 lines
750 B
Rust

use crate::render::RenderError;
use client;
use std::any;
/// Represents any error that may be triggered by Voxygen.
#[derive(Debug)]
pub enum Error {
/// An error relating to the internal client.
ClientError(client::Error),
/// A miscellaneous error relating to a backend dependency.
BackendError(Box<dyn any::Any>),
/// An error relating the rendering subsystem.
RenderError(RenderError),
/// A miscellaneous error with an unknown or unspecified source.
Other(failure::Error),
}
impl From<RenderError> for Error {
fn from(err: RenderError) -> Self {
Error::RenderError(err)
}
}
impl From<client::Error> for Error {
fn from(err: client::Error) -> Self {
Error::ClientError(err)
}
}