use std::io;
use std::str;
use thiserror::Error;
use {header, point, reader, vlr, writer, Transform, Version};
#[derive(Error, Debug)]
pub enum Error {
#[error("feature {feature} is not supported by version {version}")]
#[allow(missing_docs)]
Feature {
version: Version,
feature: &'static str,
},
#[error(transparent)]
Header(#[from] header::Error),
#[error("the transform {transform} cannot be inversely applied to {n}")]
#[allow(missing_docs)]
InverseTransform { n: f64, transform: Transform },
#[error(transparent)]
Io(#[from] io::Error),
#[error(
"the las data is laszip compressed, but laszip compression is not supported by this build"
)]
Laszip,
#[error("this string is not ascii: {0}")]
NotAscii(String),
#[error("the bytes are not zero-filled: {0:?}")]
NotZeroFilled(Vec<u8>),
#[error(transparent)]
Point(#[from] point::Error),
#[error(transparent)]
Reader(#[from] reader::Error),
#[error("string is too long for a slice of length {len}: {string}")]
#[allow(missing_docs)]
StringTooLong { string: String, len: usize },
#[error(transparent)]
Utf8(#[from] str::Utf8Error),
#[error(transparent)]
Writer(#[from] writer::Error),
#[error(transparent)]
Vlr(#[from] vlr::Error),
#[cfg(feature = "laz")]
#[error("laszip error: {0}")]
LasZipError(laz::LasZipError),
#[cfg(feature = "laz")]
#[error("laszip vlr not found")]
LasZipVlrNotFound,
}
#[cfg(feature = "laz")]
impl From<laz::LasZipError> for Error {
fn from(error: laz::LasZipError) -> Error {
Error::LasZipError(error)
}
}