di2ag / chp_api

The NCATS Connections Hypothesis Provider (CHP) API
Apache License 2.0
0 stars 11 forks source link

Ill-formed Query Graph returns 502 error codes #14

Closed GregHydeDartmouth closed 3 years ago

GregHydeDartmouth commented 3 years ago

Describe the bug Requests to the CHP api using ill-formed query graphs results in a 502 error code being returned. 502 is a "Bad Gateway error". Confirmed in the docker log were the correct exception messages. Expected was a 500 error.

To Reproduce Using the following Query Graph structure:

reasoner_std['query_graph']['nodes']['n0'] = { 'category':'biolink:Gene'} reasoner_std['query_graph']['nodes']['n1'] = { 'category':'biolink:Drug', 'id':'CHEMBL:CHEMBL88' } reasoner_std['query_graph']['edges']['e0'] = { 'predicate':'biolink:affects', 'subject': 'n1', 'object': 'n0' } In the one-hop wildcard query will fail. The issue is that we anticipate the object node having the curie, whether ensembl for gene or chembl for drug.

Expected behavior 500 Error

Additional context This issue should also double as a feature request. At the message level we should include LogEntry objects (for specification see: https://github.com/NCATSTranslator/ReasonerAPI/blob/master/TranslatorReasonerAPI.yaml) This object can hold on to our internal exception messages so that they can be passed back to the requester as well as other helpful debugging information.

GregHydeDartmouth commented 3 years ago

Should be covered in PR 16