Commit e8058fc4 by G

show full json representation of the error in case of general error (from device generally)

parent 7dc62222
......@@ -96,10 +96,13 @@ const useOrangeMoney = (
await transactionsStatusMutation.mutateAsync(orderId);
closeModal();
navigation?.getParent()?.navigate("paymentResultScreen");
} catch (error) {
log.error("openBrowserThenCheckStatus |", error);
} catch (error: unknown) {
log.error("openBrowserThenCheckStatus Catch Block|", error);
if (error instanceof Error) {
log.debug("1");
if (error.name === "ORANGE_PAYMENT_IN_PROGRESS") {
log.debug("2");
log.warn("openBrowserThenCheckStatus | ORANGE_PAYMENT_IN_PROGRESS");
await showModal(
<InformationModal
......@@ -108,12 +111,14 @@ const useOrangeMoney = (
onPress={() => openBrowserThenCheckStatus(paymentUrl, orderId)}
/>,
);
log.debug("3");
} else if (error.name === "ORANGE_PAYMENT_FAILED") {
showModal(<ErrorModal message="Le paiment à échoué." />);
log.error("openBrowserThenCheckStatus | ORANGE_PAYMENT_FAILED");
}
log.debug("4 --", error.name);
} else {
log.error("openBrowserThenCheckStatus |", error);
log.error("openBrowserThenCheckStatus Else Block|", error);
closeModal();
throw error;
}
......
......@@ -34,7 +34,7 @@ const axiosRequest = async <T>({ ...options }): Promise<T> => {
// log.error("Axios RequestError Reponse message:: ", error.message);
// log.error("Axios RequestError Reponse name:: ", error.response?.data);
} else {
log.error("axiosRequest | General RequestError :: ", error);
log.error("axiosRequest | General RequestError :: ", JSON.stringify(error, null, 2));
}
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
return onError(error as any);
......
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