-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bubble up python exceptions to response? #11
Comments
as discussed in #17 (comment) we may want to do this by adopting the JSON API standard for the formatting of our responses and reporting errors in the |
Note: the response format of the aiida-core rest api also includes the {
"data": {
"nodes ": [
{
"ctime": "Sun, 21 Jul 2019 11:45:52 GMT",
"full_type": "data.dict.Dict.|",
"id": 102618,
"label": "",
"mtime": "Sun, 21 Jul 2019 11:45:52 GMT",
"node_type": "data.dict.Dict.",
"process_type": null,
"user_id": 4,
"uuid": "a43596fe-3d95-4d9b-b34a-acabc21d7a1e"
},
{
"ctime": "Sun, 21 Jul 2019 18:18:26 GMT",
"full_type": "data.remote.RemoteData.|",
"id": 102617,
"label": "",
"mtime": "Sun, 21 Jul 2019 18:18:26 GMT",
"node_type": "data.remote.RemoteData.",
"process_type": null,
"user_id": 4,
"uuid": "12f95e1c-69df-4a4b-9b06-8e69072e6108"
}
]
},
"id": null,
"method": "GET",
"path": "/api/v4/nodes",
"query_string": "limit=2&offset=8&orderby=-id",
"resource_type": "nodes",
"url": "http://localhost:5000/api/v4/nodes?limit=2&offset=8&orderby=-id",
"url_root": "http://localhost:5000/"
} These would be incompatible with the JSON API standard, which only allows @asle85 however mentions that these extra fields are currently not used in Materials Cloud explore & discover sections. For the individual resources, however, JSON API also mandates a specific structure, see example {
"type": "articles",
"id": "1",
"attributes": {
"title": "JSON:API paints my bikeshed!",
"body": "The shortest article. Ever.",
"created": "2015-05-22T14:56:29.000Z",
"updated": "2015-05-22T14:56:28.000Z"
}
} I.e. we would need to
On the plus side, this would be how the graphql endpoint returns data |
While testing manually we realized that errors like forgetting to load the AiiDA profile are reported as an internal server errors
We may want to include this info in the response (although this may be a security concern)
The text was updated successfully, but these errors were encountered: