-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.rs
More file actions
116 lines (79 loc) · 4.77 KB
/
Copy patherror.rs
File metadata and controls
116 lines (79 loc) · 4.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
use std::path::PathBuf;
use reqwest::StatusCode;
use snafu::Snafu;
pub type Result<T> = std::result::Result<T, Error>;
#[allow(clippy::result_large_err)]
#[derive(Debug, Snafu)]
#[snafu(visibility(pub))]
pub enum Error {
#[snafu(display("Could not get current directory, error: {source}"))]
GetCurrentDirectory { source: std::io::Error },
#[snafu(display("Build HTTP client, error: {source}"))]
BuildHttpClient { source: reqwest::Error },
#[snafu(display("Connection timed out"))]
ConnectionTimedOut,
#[snafu(display("Destination file `{}` already exists", file_path.display()))]
DestinationFileExists { file_path: PathBuf },
#[snafu(display("Fetching directory is not supported"))]
FetchingDirectory,
#[snafu(display("The chunk size is invalid, value: {value}"))]
BadChunkSize { value: u64 },
#[snafu(display("URI {uri} is not a valid MinIO URL"))]
InvalidMinioUrl { uri: http::Uri },
#[snafu(display("Hostname is not a provided"))]
HostnameNotProvided,
#[snafu(display("Resource not found, URI: {uri}"))]
NotFound { uri: http::Uri },
#[snafu(display("The scheme `{scheme}` is not supported"))]
UnsupportedScheme { scheme: String },
#[snafu(display("Unknown HTTP error, status code: {status_code}"))]
UnknownHttpError { status_code: StatusCode },
#[snafu(display("Could not parse length from HTTP header, value: {value}, error: {source}"))]
ParseLengthFromHttpHeader { value: String, source: std::num::ParseIntError },
#[snafu(display("Error occurs while building OpenDAL operator, error: {source}"))]
BuildOpenDALOperator { source: opendal::Error },
#[snafu(display("Error occurs while opening file `{}`, error: {source}", file_path.display()))]
OpenFile { file_path: PathBuf, source: std::io::Error },
#[snafu(display("Error occurs while creating file `{}`, error: {source}", file_path.display()))]
CreateFile { file_path: PathBuf, source: std::io::Error },
#[snafu(display("Error occurs while creating control file `{}`, error: {source}", file_path.display()))]
CreateControlFile { file_path: PathBuf, source: std::io::Error },
#[snafu(display("Error occurs while writing file `{}`, error: {source}", file_path.display()))]
WriteFile { file_path: PathBuf, source: std::io::Error },
#[snafu(display("Error occurs while flushing file `{}`, error: {source}", file_path.display()))]
FlushFile { file_path: PathBuf, source: std::io::Error },
#[snafu(display("Error occurs while seeking file `{}`, error: {source}", file_path.display()))]
SeekFile { file_path: PathBuf, source: std::io::Error },
#[snafu(display("Error occurs while resizing file `{}`, error: {source}", file_path.display()))]
ResizeFile { file_path: PathBuf, source: std::io::Error },
#[snafu(display("Error occurs while creating reader, error: {source}"))]
CreateReader { source: opendal::Error },
#[snafu(display("Error occurs while reading from reader, error: {source}"))]
ReadFromReader { source: std::io::Error },
#[snafu(display("Error occurs while seeking in reader, error: {source}"))]
SeekReader { source: std::io::Error },
#[snafu(display("Error occurs while cloning file instance `{}`, error: {source}", file_path.display()))]
CloneFileInstance { file_path: PathBuf, source: std::io::Error },
#[snafu(display("Error occurs while fetching range via HTTP, error: {source}"))]
FetchRangeFromHttp { source: reqwest::Error },
#[snafu(display("Error occurs while fetching bytes from HTTP, error: {source}"))]
FetchBytesFromHttp { source: reqwest::Error },
#[snafu(display("Error occurs while fetching bytes from MinIO, error: {source}"))]
FetchBytesFromMinio { source: opendal::Error },
#[snafu(display("Error occurs while getting metadata from SFTP server, error: {source}"))]
GetMetadataFromSftp { source: opendal::Error },
#[snafu(display("Error occurs while fetching HTTP header, error: {source}"))]
FetchHttpHeader { source: reqwest::Error },
#[snafu(display("Failed to get length of file `{}`, error: {source}", file_path.display()))]
GetFileLength { file_path: PathBuf, source: std::io::Error },
#[snafu(display("Error occurs while getting metadata from MinIO, error: {source}"))]
GetMetadataFromMinio { source: opendal::Error },
#[snafu(display("Error occurs while getting metadata from file system, error: {source}"))]
GetMetadataFromFileSystem { source: opendal::Error },
#[snafu(display("MinIO alias `{alias}` not found"))]
MinioAliasNotFound { alias: String },
#[snafu(display("SSH configuration `{endpoint}` not found"))]
SshConfigNotFound { endpoint: String },
#[snafu(display("Error occurs while join tokio task, error: {source}"))]
JoinTask { source: tokio::task::JoinError },
}