Files
Graphite/graphene/src/error.rs
0HyperCube 469e40d4e9 Refactor font loading from per-document to the portfolio (#659)
* Cleanup default font loading

* Refactor fonts

* Fix menulist mouse navigation

* Format

* Formatting

* Move default font into consts.rs

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-05-26 16:27:33 -07:00

24 lines
571 B
Rust

use super::LayerId;
use crate::boolean_ops::BooleanOperationError;
/// A set of different errors that can occur when using Graphene.
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum DocumentError {
LayerNotFound(Vec<LayerId>),
InvalidPath,
IndexOutOfBounds,
NotAFolder,
NonReorderableSelection,
NotAShape,
NotText,
NotAnImage,
InvalidFile(String),
}
// TODO: change how BooleanOperationErrors are handled
impl From<BooleanOperationError> for DocumentError {
fn from(err: BooleanOperationError) -> Self {
DocumentError::InvalidFile(format!("{:?}", err))
}
}