libhdfs3_sys/err.rs
1use std::fmt::Display;
2
3/// Errors that can occur when accessing HDFS
4#[derive(thiserror::Error, Debug)]
5pub enum HdfsErr {
6 /// File path
7 FileNotFound(String),
8 /// File path
9 FileAlreadyExists(String),
10 /// Namenode address
11 CannotConnectToNameNode(String),
12 /// URL
13 InvalidUrl(String),
14 /// Description
15 Miscellaneous(String),
16}
17
18impl Display for HdfsErr {
19 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20 write!(f, "{:?}", self)
21 }
22}