gltforge_unity/error/
mod.rs1use error_location::ErrorLocation;
2use gltforge::schema::{AccessorComponentType, MeshPrimitiveMode};
3use thiserror::Error;
4
5#[derive(Error, Debug)]
6pub enum ConvertError {
7 #[error("unsupported primitive mode {mode:?} {location}")]
8 UnsupportedPrimitiveMode {
9 mode: MeshPrimitiveMode,
10 location: ErrorLocation,
11 },
12
13 #[error("no POSITION attribute on primitive {location}")]
14 NoPositionAttribute { location: ErrorLocation },
15
16 #[error("POSITION accessor index out of range {location}")]
17 PositionAccessorOutOfRange { location: ErrorLocation },
18
19 #[error("POSITION accessor must be VEC3 FLOAT {location}")]
20 InvalidPositionType { location: ErrorLocation },
21
22 #[error("primitive has no index accessor {location}")]
23 NoIndices { location: ErrorLocation },
24
25 #[error("index accessor index out of range {location}")]
26 IndexAccessorOutOfRange { location: ErrorLocation },
27
28 #[error("unsupported index component type {component_type:?} {location}")]
29 UnsupportedIndexComponentType {
30 component_type: AccessorComponentType,
31 location: ErrorLocation,
32 },
33
34 #[error("accessor resolution failed: {source} {location}")]
35 Resolve {
36 #[source]
37 source: gltforge::error::ParseError,
38 location: ErrorLocation,
39 },
40}
41
42pub type ConvertResult<T> = std::result::Result<T, ConvertError>;