File tree Expand file tree Collapse file tree 4 files changed +8
-16
lines changed
Expand file tree Collapse file tree 4 files changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,6 @@ pub enum HGNCError {
3232 Request ( #[ from] reqwest:: Error ) ,
3333 #[ error( "Something went wrong when using Mutex: {0}" ) ]
3434 MutexError ( String ) ,
35- #[ error( "HGNC fetch request for {gene} failed. Error: {err}." ) ]
36- FetchRequest { gene : String , err : String } ,
3735 #[ error( "HgncAPI returned an error on {attempts} attempts to retrieve data about gene {gene}" ) ]
3836 HgncAPI { gene : String , attempts : usize } ,
3937}
Original file line number Diff line number Diff line change @@ -45,13 +45,11 @@ impl HGNCClient {
4545 . get ( url)
4646 . header ( "User-Agent" , "PIVOT" )
4747 . header ( "Accept" , "application/json" )
48- . send ( )
49- . map_err ( |err| HGNCError :: FetchRequest {
50- gene : query. inner ( ) . to_string ( ) ,
51- err : err. to_string ( ) ,
52- } ) ?;
48+ . send ( ) ;
5349
54- if response. status ( ) . is_success ( ) {
50+ if let Ok ( response) = response
51+ && response. status ( ) . is_success ( )
52+ {
5553 let gene_response = response. json :: < GeneResponse > ( ) ?;
5654 return Ok ( gene_response. response . docs ) ;
5755 }
Original file line number Diff line number Diff line change @@ -65,8 +65,6 @@ pub enum HGVSError {
6565 VariantValidatorAPI { hgvs : String , attempts : usize } ,
6666 #[ error( "VariantValidator response for {hgvs} had an unexpected format: {format_issue}" ) ]
6767 VariantValidatorResponseUnexpectedFormat { hgvs : String , format_issue : String } ,
68- #[ error( "VariantValidator fetch request for {hgvs} failed. Error: {err}." ) ]
69- FetchRequest { hgvs : String , err : String } ,
7068 #[ error( transparent) ]
7169 CacheDatabase ( #[ from] DatabaseError ) ,
7270 #[ error( transparent) ]
Original file line number Diff line number Diff line change @@ -91,13 +91,11 @@ impl HGVSClient {
9191 . get ( fetch_url)
9292 . header ( "User-Agent" , "PIVOT" )
9393 . header ( "Accept" , "application/json" )
94- . send ( )
95- . map_err ( |err| HGVSError :: FetchRequest {
96- hgvs : unvalidated_hgvs. to_string ( ) ,
97- err : err. to_string ( ) ,
98- } ) ?;
94+ . send ( ) ;
9995
100- if response. status ( ) . is_success ( ) {
96+ if let Ok ( response) = response
97+ && response. status ( ) . is_success ( )
98+ {
10199 return response. json :: < VariantValidatorResponse > ( ) . map_err ( |err| {
102100 HGVSError :: DeserializeVariantValidatorResponseToSchema {
103101 hgvs : unvalidated_hgvs. to_string ( ) ,
You can’t perform that action at this time.
0 commit comments