← All changes
|
src/Subscriptions/Repositories/SubscriptionNotesRepository.php
+6
-3
4.15.4
→
4.18.0
View file →
| @@ -46,8 +46,9 @@ | ||
| 46 | 46 | ->get(); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | + * @since 4.18.0 Keep the original error as the previous exception when the write fails. | |
| 50 | 51 | * @since 4.8.0 |
| 51 | 52 | * |
| 52 | 53 | * @throws Exception|InvalidArgumentException |
| 53 | 54 | */ |
| @@ -91,9 +92,9 @@ | ||
| 91 | 92 | DB::query('ROLLBACK'); |
| 92 | 93 | |
| 93 | 94 | Log::error('Failed creating a subscription note', compact('subscriptionNote')); |
| 94 | 95 | |
| 95 | - throw new $exception('Failed creating a subscription note'); | |
| 96 | + throw new Exception('Failed creating a subscription note', 0, $exception); | |
| 96 | 97 | } |
| 97 | 98 | |
| 98 | 99 | DB::query('COMMIT'); |
| 99 | 100 | |
| @@ -103,8 +104,9 @@ | ||
| 103 | 104 | Hooks::doAction('givewp_subscription_note_created', $subscriptionNote); |
| 104 | 105 | } |
| 105 | 106 | |
| 106 | 107 | /** |
| 108 | + * @since 4.18.0 Keep the original error as the previous exception when the write fails. | |
| 107 | 109 | * @since 4.8.0 |
| 108 | 110 | * |
| 109 | 111 | * @throws Exception|InvalidArgumentException |
| 110 | 112 | */ |
| @@ -133,9 +135,9 @@ | ||
| 133 | 135 | DB::query('ROLLBACK'); |
| 134 | 136 | |
| 135 | 137 | Log::error('Failed updating a subscription note', compact('subscriptionNote')); |
| 136 | 138 | |
| 137 | - throw new $exception('Failed updating a subscription note'); | |
| 139 | + throw new Exception('Failed updating a subscription note', 0, $exception); | |
| 138 | 140 | } |
| 139 | 141 | |
| 140 | 142 | DB::query('COMMIT'); |
| 141 | 143 | |
| @@ -142,8 +144,9 @@ | ||
| 142 | 144 | Hooks::doAction('givewp_subscription_note_updated', $subscriptionNote); |
| 143 | 145 | } |
| 144 | 146 | |
| 145 | 147 | /** |
| 148 | + * @since 4.18.0 Keep the original error as the previous exception when the write fails. | |
| 146 | 149 | * @since 4.8.0 |
| 147 | 150 | * |
| 148 | 151 | * @throws Exception |
| 149 | 152 | */ |
| @@ -165,9 +168,9 @@ | ||
| 165 | 168 | DB::query('ROLLBACK'); |
| 166 | 169 | |
| 167 | 170 | Log::error('Failed deleting a subscription note', compact('subscriptionNote')); |
| 168 | 171 | |
| 169 | - throw new $exception('Failed deleting a subscription note'); | |
| 172 | + throw new Exception('Failed deleting a subscription note', 0, $exception); | |
| 170 | 173 | } |
| 171 | 174 | |
| 172 | 175 | DB::query('COMMIT'); |
| 173 | 176 | |