diff options
author | Nan Zhou <nanzhoumails@gmail.com> | 2022-08-12 21:05:09 +0300 |
---|---|---|
committer | Nan Zhou <nanzhoumails@gmail.com> | 2022-09-21 01:13:00 +0300 |
commit | 3590bd1dee5a0e56d4d282f0a1e3cf2c8804dfa1 (patch) | |
tree | 24dfa423506c14bbef29451d09b366fdfe7a5317 /scripts | |
parent | 6e5a32691a861ef54f7b2e9abd90181a369085d6 (diff) | |
download | bmcweb-3590bd1dee5a0e56d4d282f0a1e3cf2c8804dfa1.tar.xz |
query: propogate errors for expand
The existing code doesn't propogate errors of subqueries correctly.
This commit corrects the behavior, so that the final response gets all
error message of subqueries and the "highest priority" HTTP code.
DMTF doesn't specify how expand queries handle error codes, since using
subqueries is an implementation choice that we made in this project.
What we did here follows existing behavior of this project, and follows
the error message section of the Redfish spec;
[1] https://redfish.dmtf.org/schemas/DSP0266_1.15.1.html#error-responses
As for now, this commit uses the worst HTTP code among all the error
code. See query_param.hpp, function |propogateErrorCode| for detailed
order of the errror codes.
Tested:
1. this is difficult to test, but I hijacked the code so it returns
errors in TaskServices, then I verified that "/redfish/v1?$expand=."
correctly returns 500 and the gets the error message set.
2. unit test so that when there are multiple errors, the final response
gets a generate error message.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I0c1ebdd9015f389801db9150d687027485f1203c
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions