Hello @kartik,
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 rejected promise with an Error wrapping the value, but it's not idiomatic:
} catch (error) {
return Promise.reject(new Error(400));
}
Hope it helps!!
ThanK you!!