Skip to content

Commit dd63852

Browse files
authored
Add more output to errors (#144)
1 parent f6792b6 commit dd63852

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

rust/src/error.rs

+19-19
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,45 @@ use thiserror::Error;
55

66
#[derive(Error, Debug)]
77
pub enum HdfsError {
8-
#[error("IO error occurred while communicating with HDFS")]
8+
#[error("IO error occurred while communicating with HDFS: {0}")]
99
IOError(#[from] io::Error),
10-
#[error("data transfer error")]
10+
#[error("data transfer error: {0}")]
1111
DataTransferError(String),
1212
#[error("checksums didn't match")]
1313
ChecksumError,
14-
#[error("invalid path")]
14+
#[error("invalid path: {0}")]
1515
InvalidPath(String),
16-
#[error("invalid argument")]
16+
#[error("invalid argument: {0}")]
1717
InvalidArgument(String),
18-
#[error("failed to parse URL")]
18+
#[error("failed to parse URL: {0}")]
1919
UrlParseError(#[from] url::ParseError),
20-
#[error("file already exists")]
20+
#[error("file already exists: {0}")]
2121
AlreadyExists(String),
22-
#[error("operation failed")]
22+
#[error("operation failed: {0}")]
2323
OperationFailed(String),
24-
#[error("file not found")]
24+
#[error("file not found: {0}")]
2525
FileNotFound(String),
26-
#[error("blocks not found")]
26+
#[error("blocks not found for {0}")]
2727
BlocksNotFound(String),
28-
#[error("path is a directory")]
28+
#[error("path is a directory: {0}")]
2929
IsADirectoryError(String),
30-
#[error("unsupported erasure coding policy")]
30+
#[error("unsupported erasure coding policy {0}")]
3131
UnsupportedErasureCodingPolicy(String),
32-
#[error("erasure coding error")]
32+
#[error("erasure coding error: {0}")]
3333
ErasureCodingError(String),
34-
#[error("operation not supported")]
34+
#[error("operation not supported: {0}")]
3535
UnsupportedFeature(String),
36-
#[error("interal error, this shouldn't happen")]
36+
#[error("interal error, this shouldn't happen: {0}")]
3737
InternalError(String),
38-
#[error("failed to decode RPC response")]
38+
#[error("failed to decode RPC response: {0}")]
3939
InvalidRPCResponse(#[from] DecodeError),
40-
#[error("RPC error")]
40+
#[error("RPC error: {0} {1}")]
4141
RPCError(String, String),
42-
#[error("fatal RPC error")]
42+
#[error("fatal RPC error: {0} {1}")]
4343
FatalRPCError(String, String),
44-
#[error("SASL error")]
44+
#[error("SASL error: {0}")]
4545
SASLError(String),
46-
#[error("GSSAPI error")]
46+
#[error("GSSAPI error: {0:?} {1} {2}")]
4747
GSSAPIError(crate::security::gssapi::GssMajorCodes, u32, String),
4848
#[error("No valid SASL mechanism found")]
4949
NoSASLMechanism,

0 commit comments

Comments
 (0)