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

A more verbose error message for schema validation #98

Closed
jugonzal07 opened this issue Jul 28, 2024 · 1 comment
Closed

A more verbose error message for schema validation #98

jugonzal07 opened this issue Jul 28, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@jugonzal07
Copy link
Collaborator

jugonzal07 commented Jul 28, 2024

Hi all,

I found myself a bit stumped debugging upgrading to a new version of copper in a new environment only to find that I was taking this message too literally.

copper/copper/cli.py

Lines 27 to 33 in fe18acd

try:
f = json.load(input_file)
# Validate input file
assert copper.Schema(f).validate() == True
except:
raise ValueError("Could not read the input file. A JSON file is expected.")

While I was able to piece together it was due to not having a valid schema, I thought the error was reporting that my JSON file was in the wrong place. Perhaps different error messages for finding the file and another for schema validation would be more clear!

@lymereJ
Copy link
Collaborator

lymereJ commented Jul 30, 2024

That makes sense, thanks for suggesting it. I'll work something out soon!

@lymereJ lymereJ self-assigned this Jul 30, 2024
@lymereJ lymereJ added the enhancement New feature or request label Jul 30, 2024
@lymereJ lymereJ changed the title Recommendation-- a more verbose error message for schema validation A more verbose error message for schema validation Jul 30, 2024
@lymereJ lymereJ closed this as completed Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants