Commit 6128d435 by G

show error modal in case of catch block triggered

parent bbb27f23
import { useModalsManagerContext } from "@/contexts/ModalsManagerContext";
import type { IpaymentStackNavigator } from "@/navigations/Types";
import {
type IorangePaymentStarter,
getTransactionStatus,
getTransactionsData,
type IorangePaymentStarter,
} from "@/utils/requests/orangePayment";
import ErrorModal from "@components/modals/ErrorModal";
import InformationModal from "@components/modals/InformationModal";
......@@ -130,6 +130,8 @@ const useOrangeMoney = (
await openBrowserThenCheckStatus(payment_url, order_id);
} catch (error) {
log.error("makePayment |", error);
showModal(<ErrorModal message="Une erreur s'est produite." />);
throw error;
} finally {
//closeModal(); // just to be ultra sure that the modal is closed
......
......@@ -5,6 +5,7 @@ import {
getTransactionStatus,
initTransaction,
} from "@/utils/requests/wavePayment";
import ErrorModal from "@components/modals/ErrorModal";
import LoadingModal from "@components/modals/LoadingModal";
import { LOG } from "@logger";
import type { NativeStackNavigationProp } from "@react-navigation/native-stack";
......@@ -118,6 +119,7 @@ const useWave = (
// await openBrowserThenCheckStatus(response.wave_launch_url, response.id);
} catch (error) {
log.error("waveTransactionHandler |", error);
showModal(<ErrorModal message="Une erreur s'est produite." />);
throw error;
}
};
......
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