1use core::fmt;
2
3#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5pub enum AffineError {
6 NonInvertibleTransform,
8 NonFiniteTransform,
10 UndefinedRotation,
12 InvalidWorldFile,
14}
15
16impl fmt::Display for AffineError {
17 fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
18 match self {
19 Self::NonInvertibleTransform => {
20 formatter.write_str("cannot invert a degenerate affine transform")
21 }
22 Self::NonFiniteTransform => {
23 formatter.write_str("affine transform contains a non-finite value")
24 }
25 Self::UndefinedRotation => {
26 formatter.write_str("rotation is undefined for this affine transform")
27 }
28 Self::InvalidWorldFile => {
29 formatter.write_str("world file must contain exactly six finite numbers")
30 }
31 }
32 }
33}
34
35impl std::error::Error for AffineError {}