From 0723d7a2fe0d4c132ff57560a63a5155f65b9958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D0=B5=D0=BC?= Date: Wed, 11 Dec 2024 11:03:31 +0300 Subject: [PATCH] added new error to route reject --- apps/hellgate/src/hg_invoice_payment.erl | 2 ++ apps/hellgate/src/hg_limiter.erl | 1 + 2 files changed, 3 insertions(+) diff --git a/apps/hellgate/src/hg_invoice_payment.erl b/apps/hellgate/src/hg_invoice_payment.erl index c02fea77..f535e617 100644 --- a/apps/hellgate/src/hg_invoice_payment.erl +++ b/apps/hellgate/src/hg_invoice_payment.erl @@ -2700,6 +2700,8 @@ hold_limit_routes(Routes0, VS, Iter, St) -> ok = hg_limiter:hold_payment_limits(TurnoverLimits, Invoice, Payment, PaymentRoute, Iter), {[Route | LimitHeldRoutes], RejectedRoutes} catch + error:(#limiter_LimitNotFound{} = LimiterError) -> + do_reject_route(LimiterError, Route, TurnoverLimits, Acc); error:(#limiter_InvalidOperationCurrency{} = LimiterError) -> do_reject_route(LimiterError, Route, TurnoverLimits, Acc); error:(#limiter_OperationContextNotSupported{} = LimiterError) -> diff --git a/apps/hellgate/src/hg_limiter.erl b/apps/hellgate/src/hg_limiter.erl index e05601cc..2ed16f12 100644 --- a/apps/hellgate/src/hg_limiter.erl +++ b/apps/hellgate/src/hg_limiter.erl @@ -367,6 +367,7 @@ process_changes_try_wrap([LimitChange | OtherLimitChanges], WithFun, Clock, Cont handle_caught_exception(Class, Reason, Stacktrace, IgnoreBusinessError) end. +handle_caught_exception(error, #limiter_LimitNotFound{}, _Stacktrace, true) -> ok; handle_caught_exception(error, #limiter_InvalidOperationCurrency{}, _Stacktrace, true) -> ok; handle_caught_exception(error, #limiter_OperationContextNotSupported{}, _Stacktrace, true) -> ok; handle_caught_exception(error, #limiter_PaymentToolNotSupported{}, _Stacktrace, true) -> ok;