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

Spec errors handled incorrectly #45

Open
lboeman opened this issue Dec 8, 2020 · 0 comments
Open

Spec errors handled incorrectly #45

lboeman opened this issue Dec 8, 2020 · 0 comments
Assignees
Labels
bug Something isn't working dashboard

Comments

@lboeman
Copy link
Contributor

lboeman commented Dec 8, 2020

Invalid properties are checked for incorrectly, causing them to bubble up through the component tree for similarly named fields.
For example, naming an inverter with an invalid name* will trigger an error on the system name field due to the naive matching approach used here:

const field = error.dataPath.split("/").pop();

Errors refer to the location of the offending value in two different formats:

  • Ajv provides the dataPath field, with a string path using / separators, e.g. /arrays/0/modules_per_string
  • API responses contain a loc key which is an array of paths. typically for a model error, preceded by body indicating that the error originates from the posted request body.

It would probably be best to create a unified error handler and coax these into a similar format.

@lboeman lboeman added the bug Something isn't working label Dec 8, 2020
@lboeman lboeman self-assigned this Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dashboard
Projects
None yet
Development

No branches or pull requests

2 participants