isabelrem / 2023-Software-Development-Assessment

MIT License
2 stars 1 forks source link

Changes made so that 500 and 404 status codes from do not cause an ex… #46

Closed TomLivesey-UoM closed 9 months ago

TomLivesey-UoM commented 9 months ago

Fix to no handling of 414 and 500 errors coming from the VV API causing an IndexError when attempting to print transcript to screen.

TomLivesey-UoM commented 9 months ago

This fix will work for now - need to have discussion about best way to extend logging to include internally of scripts called in main.py().

jess789550 commented 9 months ago

I'm still getting an error?

If you would like to search by R-code, enter 1. If you would like to enter a disease description, enter 2. 2 Enter your search term: (e.g., R128 or pneumothorax) mitochondrial Which genome build would you like to use? Enter 1 for GRCh37. Enter 2 for GRCh38. 1 2023-12-11 14:20:44,557 INFO: Starting PanelSearch with input type: disease_desc Please wait. Fetching data. mitochondrial complex v deficiency, tmem70 type mitochondrial disorders mitochondrial disorder with complex i deficiency mitochondrial disorder with complex ii deficiency mitochondrial disorder with complex iii deficiency mitochondrial disorder with complex iv deficiency mitochondrial disorder with complex v deficiency mitochondrial dna maintenance disorder mitochondrial liver disease, including transient infantile liver failure mitochondrial neurogastrointestinal encephalopathy possible mitochondrial disorder - nuclear genes Please choose an option from above: possible mitochondrial disorder - nuclear genes You have chosen possible mitochondrial disorder - nuclear genes GRch37 build selected. Could not get transcript and exon information from VV API. The status code was: 404

jess789550 commented 9 months ago

If you would like to search by R-code, enter 1. If you would like to enter a disease description, enter 2. 2 Enter your search term: (e.g., R128 or pneumothorax) pneumothorax Which genome build would you like to use? Enter 1 for GRCh37. Enter 2 for GRCh38. 1 2023-12-11 14:22:03,430 INFO: Starting PanelSearch with input type: disease_desc Please wait. Fetching data. pneumothorax - familial Please choose an option from above: pneumothorax - familial You have chosen pneumothorax - familial GRch37 build selected. Traceback (most recent call last): File "C:\Users\jessica\2023-Software-Development-Assessment\PanelSearch\main.py", line 130, in main() File "C:\Users\jessica\2023-Software-Development-Assessment\PanelSearch\main.py", line 106, in main panel_data = panelapp_search_parse(RESPONSE.json(), SEARCH.genome_build) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\jessica\2023-Software-Development-Assessment\PanelSearch\PanelApp_Request_Parse.py", line 100, in panelapp_search_parse OUTPUT = vv_request_parse(VV_RESP.json(), OUTPUT) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\jessica\2023-Software-Development-Assessment\PanelSearch\VV_Request_Parse.py", line 12, in vv_request_parse ID = vv_gene_record['hgnc']


KeyError: 'hgnc'
TomLivesey-UoM commented 9 months ago

1st is ok - it's handling the error that VV API is having - 404 code suggests something else is wrong so am looking at this in a separate issue.

2nd pic is a separate issue - also looking at

Please check using R-codes as well as terms and tell me if anything gives an IndexError, thanks!

TomLivesey-UoM commented 9 months ago

The above errors were the result of the VV API going down for maintenance and have been resolved.