Closed dora-gt closed 4 years ago
It looks like we can use https://github.com/dtolnay/path-to-error along with the error message returned by serde_json
to provide a more helpful error message
Because the testnet document depends on test.xpring.tech
, I'll try to improve this in parallel.
memo:
I think there are 2 options to implement this.
tower-web
type
might be difficult because it should not be project specific values.
extract
trait on our own
type
s like https://errors.interledger.org/<api>/<error_type>
.If you @interledger-rs/contributors have any opinion, please tell me.
I'm in the process of switching everything over to warp
(away from tower-web
) so I wouldn't focus on implementing this for tower-web
.
warp
gives you a bit more manual control over error handling so it shouldn't be too difficult to implement once we decide what we want. See how "rejections" are handled here. We can change our own ApiError
type to include more details of the error and then change that error handling logic to include more details in the HTTP response body.
Ahhh! sorry, I forgot. Yes, we should use warp
. Thank you. I'll check the code.
Closing, our error handling is very nice now
Currently HTTP endpoints return JSON like:
This tells nothing for developers and it's hard to assume what's the problem. We need to improve this.
https://interledger.slack.com/archives/CHC51E54J/p1566983918002000