Skip to content

Warning: a promise was rejected with a non-error: [object Object] #1047

Discussion options

You must be logged in to vote

@radekmie Hi, I am using GraphQL schema, but I did the following to remove the warning, don't know if its the right way though but it
seems to work.

I created a custom class

class AutoFormValidationError extends Error {
    constructor(details) {
        super("AutoForm Validation Error"); // (1)
        this.name = "AutoFormValidationError"; // (2)
        this.details = details;
    }    
}

And I return it in onValidate , my onValidate returns a promise.

resolve(new AutoFormValidationError(details));

Replies: 3 comments 13 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@radekmie
Comment options

@simplecommerce
Comment options

Answer selected by radekmie
Comment options

You must be logged in to vote
11 replies
@simplecommerce
Comment options

@wadamek65
Comment options

@simplecommerce
Comment options

@wadamek65
Comment options

@radekmie
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants