File tree Expand file tree Collapse file tree 3 files changed +8
-16
lines changed Expand file tree Collapse file tree 3 files changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -260,23 +260,13 @@ impl From<StoreError> for QueryExecutionError {
260
260
}
261
261
262
262
/// Error caused while processing a [Query](struct.Query.html) request.
263
- #[ derive( Debug ) ]
263
+ #[ derive( Clone , Debug ) ]
264
264
pub enum QueryError {
265
265
EncodingError ( FromUtf8Error ) ,
266
- ParseError ( failure :: Error ) ,
266
+ ParseError ( Arc < anyhow :: Error > ) ,
267
267
ExecutionError ( QueryExecutionError ) ,
268
268
}
269
269
270
- impl Clone for QueryError {
271
- fn clone ( & self ) -> Self {
272
- match self {
273
- QueryError :: EncodingError ( e) => QueryError :: EncodingError ( e. clone ( ) ) ,
274
- QueryError :: ParseError ( e) => QueryError :: ParseError ( failure:: err_msg ( e. to_string ( ) ) ) ,
275
- QueryError :: ExecutionError ( e) => QueryError :: ExecutionError ( e. clone ( ) ) ,
276
- }
277
- }
278
- }
279
-
280
270
impl From < FromUtf8Error > for QueryError {
281
271
fn from ( e : FromUtf8Error ) -> Self {
282
272
QueryError :: EncodingError ( e)
Original file line number Diff line number Diff line change @@ -48,8 +48,9 @@ impl Future for GraphQLRequest {
48
48
} ) ?;
49
49
50
50
// Parse the "query" field of the JSON body
51
- let document = graphql_parser:: parse_query ( query_string)
52
- . map_err ( |e| GraphQLServerError :: from ( QueryError :: ParseError ( e. into ( ) ) ) ) ?;
51
+ let document = graphql_parser:: parse_query ( query_string) . map_err ( |e| {
52
+ GraphQLServerError :: from ( QueryError :: ParseError ( Arc :: new ( e. compat ( ) . into ( ) ) ) )
53
+ } ) ?;
53
54
54
55
// Parse the "variables" field of the JSON body, if present
55
56
let variables = match obj. get ( "variables" ) {
Original file line number Diff line number Diff line change @@ -49,8 +49,9 @@ impl Future for IndexNodeRequest {
49
49
} ) ?;
50
50
51
51
// Parse the "query" field of the JSON body
52
- let document = graphql_parser:: parse_query ( query_string)
53
- . map_err ( |e| GraphQLServerError :: from ( QueryError :: ParseError ( e. into ( ) ) ) ) ?;
52
+ let document = graphql_parser:: parse_query ( query_string) . map_err ( |e| {
53
+ GraphQLServerError :: from ( QueryError :: ParseError ( Arc :: new ( e. compat ( ) . into ( ) ) ) )
54
+ } ) ?;
54
55
55
56
// Parse the "variables" field of the JSON body, if present
56
57
let variables = match obj. get ( "variables" ) {
You can’t perform that action at this time.
0 commit comments