Skip to content

Commit c699fc1

Browse files
remove unused error variants
1 parent 0c82fe1 commit c699fc1

2 files changed

Lines changed: 1 addition & 107 deletions

File tree

crates/api-snowflake-rest/src/server/error.rs

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,6 @@ pub type Result<T> = std::result::Result<T, Error>;
2020
#[snafu(visibility(pub(crate)))]
2121
#[error_stack_trace::debug]
2222
pub enum Error {
23-
#[snafu(display("Failed to decompress GZip body"))]
24-
GZipDecompress {
25-
#[snafu(source)]
26-
error: std::io::Error,
27-
#[snafu(implicit)]
28-
location: Location,
29-
},
30-
31-
#[snafu(display("Failed to parse login request"))]
32-
LoginRequestParse {
33-
#[snafu(source)]
34-
error: serde_json::Error,
35-
#[snafu(implicit)]
36-
location: Location,
37-
},
38-
39-
#[snafu(display("Failed to parse query body"))]
40-
QueryBodyParse {
41-
#[snafu(source)]
42-
error: serde_json::Error,
43-
#[snafu(implicit)]
44-
location: Location,
45-
},
46-
4723
#[snafu(display("Missing auth token"))]
4824
MissingAuthToken {
4925
#[snafu(implicit)]
@@ -56,20 +32,6 @@ pub enum Error {
5632
location: Location,
5733
},
5834

59-
#[snafu(display("Invalid uuid format"))]
60-
InvalidUuidFormat {
61-
#[snafu(source)]
62-
error: uuid::Error,
63-
#[snafu(implicit)]
64-
location: Location,
65-
},
66-
67-
#[snafu(display("Missing DBT session"))]
68-
MissingDbtSession {
69-
#[snafu(implicit)]
70-
location: Location,
71-
},
72-
7335
#[snafu(display("Invalid auth data"))]
7436
InvalidAuthData {
7537
#[snafu(implicit)]
@@ -82,14 +44,6 @@ pub enum Error {
8244
location: Location,
8345
},
8446

85-
#[snafu(display("Failed to parse row JSON"))]
86-
RowParse {
87-
#[snafu(source)]
88-
error: serde_json::Error,
89-
#[snafu(implicit)]
90-
location: Location,
91-
},
92-
9347
#[snafu(display("UTF8 error: {error}"))]
9448
Utf8 {
9549
#[snafu(source)]
@@ -211,29 +165,14 @@ impl Error {
211165
_ => (http::StatusCode::OK, SqlState::Success, error_code),
212166
}
213167
}
214-
Self::GZipDecompress { .. }
215-
| Self::LoginRequestParse { .. }
216-
| Self::QueryBodyParse { .. }
217-
| Self::InvalidUuidFormat { .. } => {
218-
// TODO: Is this need a fix? Bad request return retriable http code
219-
(
220-
http::StatusCode::BAD_REQUEST,
221-
SqlState::Success,
222-
ErrorCode::Other,
223-
)
224-
}
225168
Self::MissingAuthToken { .. }
226-
| Self::MissingDbtSession { .. }
227169
| Self::InvalidAuthData { .. }
228170
| Self::InvalidAuthToken { .. } => (
229171
http::StatusCode::UNAUTHORIZED,
230172
SqlState::Success,
231173
ErrorCode::Other,
232174
),
233-
Self::RowParse { .. }
234-
| Self::Utf8 { .. }
235-
| Self::Arrow { .. }
236-
| Self::NotImplemented { .. } => {
175+
Self::Utf8 { .. } | Self::Arrow { .. } | Self::NotImplemented { .. } => {
237176
(http::StatusCode::OK, SqlState::Success, ErrorCode::Other)
238177
}
239178
};

crates/catalog-metastore/src/error.rs

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,6 @@ pub enum Error {
2525
location: Location,
2626
},
2727

28-
#[snafu(display("Volume: Validation failed. Reason: {reason}"))]
29-
VolumeValidationFailed {
30-
reason: String,
31-
#[snafu(implicit)]
32-
location: Location,
33-
},
34-
35-
#[snafu(display("Volume: Missing credentials"))]
36-
VolumeMissingCredentials {
37-
#[snafu(implicit)]
38-
location: Location,
39-
},
40-
41-
#[snafu(display("Cloud provider not implemented"))]
42-
CloudProviderNotImplemented {
43-
provider: String,
44-
#[snafu(implicit)]
45-
location: Location,
46-
},
47-
4828
#[snafu(display("ObjectStore: {error}"))]
4929
ObjectStore {
5030
#[snafu(source)]
@@ -53,25 +33,6 @@ pub enum Error {
5333
location: Location,
5434
},
5535

56-
#[snafu(display("ObjectStore path: {error}"))]
57-
ObjectStorePath {
58-
#[snafu(source)]
59-
error: object_store::path::Error,
60-
#[snafu(implicit)]
61-
location: Location,
62-
},
63-
64-
#[snafu(display(
65-
"Unable to create directory for File ObjectStore path {path}, error: {error}"
66-
))]
67-
CreateDirectory {
68-
path: String,
69-
#[snafu(source)]
70-
error: std::io::Error,
71-
#[snafu(implicit)]
72-
location: Location,
73-
},
74-
7536
#[snafu(display("Metastore object of type {type_name} with name {name} already exists"))]
7637
ObjectAlreadyExists {
7738
type_name: String,
@@ -80,12 +41,6 @@ pub enum Error {
8041
location: Location,
8142
},
8243

83-
#[snafu(display("Metastore object not found"))]
84-
ObjectNotFound {
85-
#[snafu(implicit)]
86-
location: Location,
87-
},
88-
8944
#[snafu(display("Volume {volume} already exists"))]
9045
VolumeAlreadyExists {
9146
volume: String,

0 commit comments

Comments
 (0)