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

allow passing an error object as message to assert #668

Merged
merged 1 commit into from
Jun 9, 2015
Merged

Conversation

nlf
Copy link
Member

@nlf nlf commented Jun 9, 2015

No description provided.

var error = root.validate(value, schema).error;
if (error) {
throw new Error(message + error.annotate());
if (!message) {
message = new Error(error.annotate());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't bother re-assigning on both, just throw.

@Marsup Marsup added the feature New functionality or improvement label Jun 9, 2015
@Marsup Marsup added this to the 6.5.0 milestone Jun 9, 2015
@Marsup Marsup self-assigned this Jun 9, 2015
Marsup added a commit that referenced this pull request Jun 9, 2015
allow passing an error object as message to assert
@Marsup Marsup merged commit fd07ac8 into master Jun 9, 2015
@Marsup Marsup deleted the assert_errors branch June 9, 2015 22:05
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New functionality or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants