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

ValidationError in console obscures issues #890

Closed
ef4 opened this issue Oct 18, 2021 · 2 comments · Fixed by #896
Closed

ValidationError in console obscures issues #890

ef4 opened this issue Oct 18, 2021 · 2 comments · Fixed by #896

Comments

@ef4
Copy link
Contributor

ef4 commented Oct 18, 2021

The ValidationError type:

export class ValidationError extends Exception {
  public description: string;
  public issues?: ValidationIssue[];

  constructor(description: string, issues?: ValidationIssue[]) {
    super(description);
    this.description = description;
    this.issues = issues;
  }
}

contains a helpful list of validation issues, but these are not visible when an unexpected ValidationError is encountered during development:

Screen Shot 2021-10-18 at 4 09 21 PM

To find the actual issues one must set a breakpoint and inspect the issues list.

@dgeb
Copy link
Member

dgeb commented Oct 25, 2021

Good call - this is an unnecessarily awkward DX (which validations are supposed to improve).

What do you think about logging (via console.error) the description and issues when a ValidationError is created and Orbit.debug === true?

@ef4
Copy link
Contributor Author

ef4 commented Nov 14, 2021

Logging is fine, but with or without logging I think the exception message itself should also incorporate the validation errors.

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

Successfully merging a pull request may close this issue.

2 participants