Answer the question
In order to leave comments, you need to log in
How to call throw new SubmissionError from a Promise?
Good time everyone.
Tell me how you can call throw new SubmissionError from Promise ?
As soon as it was not perverted, instead of actions that usually occur in synchronous code when calling throw new SubmissionError , in asynchronous code a line like this is displayed in the console: Uncaught (in promise) .
Something like this:
In the component class
err = (error) => {
throw error;
}
submit(values) {
...
let p = new Promise(resolve => {setTimeout(resolve, 3000, new SubmissionError({time: 'Измените период', _error: "Login failed!", }))});
p.then(result => this.err(result));
...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question