How to reject in async/await syntax?
Your best bet is to throw an Error wrapping the value, which results in a rejected promise with an Error wrapping the value: } catch (error) { throw new Error(400); } You can also just throw the value, but then there’s no stack trace information: } catch (error) { throw 400; } Alternately, return a … Read more