@@ -20,30 +20,6 @@ pub type Result<T> = std::result::Result<T, Error>;
2020#[ snafu( visibility( pub ( crate ) ) ) ]
2121#[ error_stack_trace:: debug]
2222pub 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 } ;
0 commit comments