|
2 | 2 | namespace Dfe\TwoCheckout; |
3 | 3 | use Dfe\TwoCheckout\Handler\DefaultT; |
4 | 4 | use Dfe\TwoCheckout\Settings as S; |
5 | | -use Exception as E; |
| 5 | +use \Throwable as Th; # 2023-08-02 "Treat `\Throwable` similar to `\Exception`": https://github.com/mage2pro/core/issues/311 |
6 | 6 | /** |
7 | 7 | * @see \Dfe\TwoCheckout\Handler\DefaultT |
8 | 8 | * @see \Dfe\TwoCheckout\Handler\RefundIssued |
@@ -40,7 +40,6 @@ final protected function type():string {return $this['message_type'];} |
40 | 40 | * 2016-03-25 |
41 | 41 | * @param array(string => mixed) $request |
42 | 42 | * @return mixed |
43 | | - * @throws E |
44 | 43 | */ |
45 | 44 | final static function p(array $request) {/** @var mixed $r */ |
46 | 45 | try { |
@@ -81,15 +80,16 @@ final static function p(array $request) {/** @var mixed $r */ |
81 | 80 | $i = df_new(df_con(__CLASS__, $suffix, DefaultT::class), $request); /** @var Handler $i */ |
82 | 81 | $r = $i->eligible() ? $i->process() : 'The event is not for our store.'; |
83 | 82 | } |
84 | | - catch (E $e) { |
| 83 | + # 2023-08-02 "Treat `\Throwable` similar to `\Exception`": https://github.com/mage2pro/core/issues/311 |
| 84 | + catch (Th $th) { |
85 | 85 | df_500(); |
86 | 86 | # 2023-07-25 |
87 | 87 | # "Change the 3rd argument of `df_sentry` from `$context` to `$extra`": https://github.com/mage2pro/core/issues/249 |
88 | | - df_sentry(__CLASS__, $e, ['request' => $request]); |
| 88 | + df_sentry(__CLASS__, $th, ['request' => $request]); |
89 | 89 | if (df_my_local()) { |
90 | | - throw $e; # 2016-03-27 Удобно видеть стек на экране. |
| 90 | + throw $th; # 2016-03-27 Удобно видеть стек на экране. |
91 | 91 | } |
92 | | - $r = __($e->getMessage()); |
| 92 | + $r = __($th->getMessage()); |
93 | 93 | } |
94 | 94 | return $r; |
95 | 95 | } |
|
0 commit comments