-
Notifications
You must be signed in to change notification settings - Fork 0
Handle failed requests for available controlled terms gracefully #54
Copy link
Copy link
Closed
Labels
releasedThis issue/pull request has been released.This issue/pull request has been released.
Description
Questions:
- should the response format be the same as for partial-success query results, e.g. with a section for the errors encountered?
- should "partial-success" terms fetching be allowed?
Decision:
If query tool fails to get terms from a node:
- For now, just return terms available from nodes that are reachable/don't error out
- Should keep the same response shape as for cohort queries e.g.:
{
"nb:Assessment": [
{
"TermURL": "cogatlas:trm_56a9137d9dce1",
"Label": "behavioral approach/inhibition systems"
},
{
"TermURL": "cogatlas:trm_55a6a8e81b7f4",
"Label": "Barratt Impulsiveness Scale"
},
...
}to:
{
"errors": [{}] ...
"responses":
{
"nb:Assessment": [
{
"TermURL": "cogatlas:trm_56a9137d9dce1",
"Label": "behavioral approach/inhibition systems"
},
{
"TermURL": "cogatlas:trm_55a6a8e81b7f4",
"Label": "Barratt Impulsiveness Scale"
},
...
},
"nodes_response_status": "..."
}When request to all nodes fail:
{
"errors": [<all errors>] ...
"responses":
{
"nb:Assessment": []
},
"nodes_response_status": "fail"
}Steps to implement:
- Switch to async requests to nodes
- Add error responses to list
- Add new response model for combined attribute response
-
Rename tests of partial success cohort queries to be more specific - Consider refactoring mixed-status JSONResponse into its own class/function?
- When requests to all nodes fail, should return
"responses": {<data_element_URI>: []}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
releasedThis issue/pull request has been released.This issue/pull request has been released.
Type
Projects
Status
Review - Done