You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, those exceptions are logged as "Unhandled exception in endpoint" since they are not HTTPError instances. CCF handles those exceptions and translates them to OData errors here:
I think we want to be careful not to turn any JSON errors into 400s, but instead just the ones that come from parsing the POST body.
If we have a json parsing error somewhere else in the stack (eg. DID resolution), we should handle that there and return a different error. If we have unexpected/unhandled json errors then we should keep returning a 500 error.
It does make sense to consistently return CBOR, rather than CBOR in the successful path, and JSON on errors, and will simplify client-writing, it is something we should consider.
Currently, those exceptions are logged as "Unhandled exception in endpoint" since they are not
HTTPError
instances. CCF handles those exceptions and translates them to OData errors here:https://github.com/microsoft/CCF/blob/6f365683de8d04bc0a37c3732c1de608989fb14e/src/node/rpc/frontend.h#L606-L619
I think we should duplicate this code so that we control the HTTP response and can then log it properly.
We could wrap CCF's JSON adapter into our own JSON adapter and emit
HTTPError
instances, for example.The text was updated successfully, but these errors were encountered: