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