Skip to content
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

parse errors are hard to troubleshoot #21

Open
rbtcollins opened this issue Feb 8, 2019 · 1 comment
Open

parse errors are hard to troubleshoot #21

rbtcollins opened this issue Feb 8, 2019 · 1 comment

Comments

@rbtcollins
Copy link
Contributor

A typical parsing error might look like this:

    Finished dev [unoptimized + debuginfo] target(s) in 3.15s
     Running `target\debug\examples\client.exe`
Error: Unable to parse response body: missing field `matchExpressions` at line 1 column 6685
 Caused by missing field `matchExpressions` at line 1 column 6685

error: process didn't exit successfully: `target\debug\examples\client.exe` (exit code: 1)

There's not enough of the original context preserved to tell whats going on - and as API contents are usually one-off, its likely that no offline fix is possible (imagine this throws during a functional test suite).

It would be good, for instance, to provide the current parse context (e.g. is it a NodeMatch) or even a tree, or the input bytes, or some combination.

@anguslees
Copy link
Owner

We're limited by what serde gives us here (or rather: improvements are best done as improvements to serde). It think the best we can do within kubernetes-rs is to keep the original text as part of this error object, so "line 1 column 6685" can be more easily interpreted.

Error handling generally needs to be improved ("needs to be implemented" would be more correct).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants