-
Notifications
You must be signed in to change notification settings - Fork 48
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
Hard-to-understand error messages from the CLI #130
Comments
Adding this to 0.4.0 to add better error messages from the CLI. We could leverage PySTAC to provide error messages, however if the errors are due to interacting with the API and parsing response status codes, then pystac-client is probably the better place to handle these. |
This might be helped/solved by #480, we should check. |
This remains an issue. The mildly-mangled [ ... most of a python dict ...] does not represent a CollectionClient instance |
Ian and I talked yesterday about how it is good to include context in error messages, but if the context is a python dict of arbitrary length it would probably be better to truncate or add an ellipsis in the middle of it. |
So this error message is (mal)formed in pystac. In particular, it is in the I like @jsignell's idea of some ellipsis-truncation better than |
As it is a cross-repo situation, I didn't flag pystac#1126 as auto-closing this issue, but with a contrived stac-api that contains a bad collection, we now get: > pystac-client % stac-client collections http://localhost:8000
JSON (id = fake-collection-id) does not represent a CollectionClient instance. This is better, but I wonder if when
|
I think for pystac-client it might make sense to catch the
Or something like that. |
As raised in #113, it can be hard to know why a given CLI command is failing, as the Exception
__str__
may or may not point the user to the source of a problem. E.g., in #113 thetype
field was incorrect at the/collections
endpoint, but you couldn't really tell that from the error message, which was... big long printout of the collection ... is not a CollectionClient instance
.Similar issues exist, e.g. in stactools stac-utils/stactools#208. At least for the subset of exceptions that are caused by malformed STAC items, we could do some sort of validation or schema checking on the offending item and report where the issue is. This may be something better suited to PySTAC itself (e.g. in a custom Exception type that contains information about why a given JSON object could not be turned into a STAC object).
The text was updated successfully, but these errors were encountered: