Commit 2e7293ca by G

update error name to match general javascript errors

parent f11d4387
...@@ -65,13 +65,13 @@ export const getTransactionStatus = async (orderId: string) => { ...@@ -65,13 +65,13 @@ export const getTransactionStatus = async (orderId: string) => {
if (response.status === "INITIATED") { if (response.status === "INITIATED") {
log.warn("Payment is still in progress, throwing error for mutation to catch"); log.warn("Payment is still in progress, throwing error for mutation to catch");
const error = new Error("Payment is still in progress"); const error = new Error("Payment is still in progress");
error.name = "PaymentInProgress"; error.name = "ORANGE_PAYMENT_IN_PROGRESS";
throw error; throw error;
} }
if (response.status === "FAILED") { if (response.status === "FAILED") {
log.warn("Payment failed, throwing error for mutation to catch"); log.warn("Payment failed, throwing error for mutation to catch");
const error = new Error("Payment failed"); const error = new Error("Payment failed");
error.name = "PaymentFailed"; error.name = "ORANGE_PAYMENT_FAILED";
throw error; throw error;
} }
log.http("getTransactionStatus |", JSON.stringify(response, null, 2)); log.http("getTransactionStatus |", JSON.stringify(response, null, 2));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment