Description
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 the type
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).