orc_format/error.rs
1//! Contains [`Error`]
2use crate::proto::stream::Kind;
3
4/// Possible errors from this crate.
5#[derive(Debug, Clone)]
6pub enum Error {
7 /// Generic error returned when the file is out of spec
8 OutOfSpec,
9 /// When a string column contains a value with invalid UTF8
10 InvalidUtf8,
11 /// When the user requests a column that does not exist
12 InvalidColumn(u32),
13 /// When the user requests a type that does not exist for the given column
14 InvalidKind(u32, Kind),
15 /// When decoding a float fails
16 DecodeFloat,
17 /// When decompression fails
18 Decompression,
19 /// When decoding the proto files fail
20 InvalidProto,
21}
22
23impl From<prost::DecodeError> for Error {
24 fn from(_: prost::DecodeError) -> Self {
25 Self::InvalidProto
26 }
27}
28
29impl From<std::io::Error> for Error {
30 fn from(_: std::io::Error) -> Self {
31 Self::OutOfSpec
32 }
33}