← All changes
|
src/Subscriptions/Repositories/SubscriptionRepository.php
+12
-6
4.16.7
→
4.18.0
View file →
| @@ -160,8 +160,9 @@ | ||
| 160 | 160 | return $notes; |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
| 164 | + * @since 4.18.0 Keep the original error as the previous exception when the write fails. | |
| 164 | 165 | * @since 4.11.0 add campaign_id column to insert |
| 165 | 166 | * @since 2.24.0 add payment_mode column to insert |
| 166 | 167 | * @since 2.21.0 replace actions with givewp_subscription_creating and givewp_subscription_created |
| 167 | 168 | * @since 2.19.6 |
| @@ -212,9 +213,9 @@ | ||
| 212 | 213 | DB::query('ROLLBACK'); |
| 213 | 214 | |
| 214 | 215 | Log::error('Failed creating a subscription', compact('subscription')); |
| 215 | 216 | |
| 216 | - throw new $exception('Failed creating a subscription'); | |
| 217 | + throw new Exception('Failed creating a subscription', 0, $exception); | |
| 217 | 218 | } |
| 218 | 219 | |
| 219 | 220 | DB::query('COMMIT'); |
| 220 | 221 | |
| @@ -226,8 +227,9 @@ | ||
| 226 | 227 | Hooks::doAction('givewp_subscription_created', $subscription); |
| 227 | 228 | } |
| 228 | 229 | |
| 229 | 230 | /** |
| 231 | + * @since 4.18.0 Keep the original error as the previous exception when the write fails. | |
| 230 | 232 | * @since 4.11.0 add campaign_id column to update |
| 231 | 233 | * @since 3.17.0 add expiration column to update |
| 232 | 234 | * @since 2.24.0 add payment_mode column to update |
| 233 | 235 | * @since 2.21.0 replace actions with givewp_subscription_updating and givewp_subscription_updated |
| @@ -272,9 +274,9 @@ | ||
| 272 | 274 | DB::query('ROLLBACK'); |
| 273 | 275 | |
| 274 | 276 | Log::error('Failed updating a subscription', compact('subscription')); |
| 275 | 277 | |
| 276 | - throw new $exception('Failed updating a subscription'); | |
| 278 | + throw new Exception('Failed updating a subscription', 0, $exception); | |
| 277 | 279 | } |
| 278 | 280 | |
| 279 | 281 | DB::query('COMMIT'); |
| 280 | 282 | |
| @@ -281,8 +283,9 @@ | ||
| 281 | 283 | Hooks::doAction('givewp_subscription_updated', $subscription); |
| 282 | 284 | } |
| 283 | 285 | |
| 284 | 286 | /** |
| 287 | + * @since 4.18.0 Keep the original error as the previous exception when the write fails. | |
| 285 | 288 | * @since 2.21.0 replace actions with givewp_subscription_deleting and givewp_subscription_deleted |
| 286 | 289 | * @since 2.20.0 consolidate meta deletion into a single query |
| 287 | 290 | * @since 2.19.6 |
| 288 | 291 | * |
| @@ -306,9 +309,9 @@ | ||
| 306 | 309 | DB::query('ROLLBACK'); |
| 307 | 310 | |
| 308 | 311 | Log::error('Failed deleting a subscription', compact('subscription')); |
| 309 | 312 | |
| 310 | - throw new $exception('Failed deleting a subscription'); | |
| 313 | + throw new Exception('Failed deleting a subscription', 0, $exception); | |
| 311 | 314 | } |
| 312 | 315 | |
| 313 | 316 | DB::query('COMMIT'); |
| 314 | 317 | |
| @@ -317,8 +320,9 @@ | ||
| 317 | 320 | return true; |
| 318 | 321 | } |
| 319 | 322 | |
| 320 | 323 | /** |
| 324 | + * @since 4.18.0 Keep the original error as the previous exception when the write fails. | |
| 321 | 325 | * @since 4.8.0 |
| 322 | 326 | * |
| 323 | 327 | * @throws Exception |
| 324 | 328 | */ |
| @@ -343,9 +347,9 @@ | ||
| 343 | 347 | DB::query('ROLLBACK'); |
| 344 | 348 | |
| 345 | 349 | Log::error('Failed trashing a subscription', compact('subscription')); |
| 346 | 350 | |
| 347 | - throw new $exception('Failed trashing a subscription'); | |
| 351 | + throw new Exception('Failed trashing a subscription', 0, $exception); | |
| 348 | 352 | } |
| 349 | 353 | |
| 350 | 354 | DB::query('COMMIT'); |
| 351 | 355 | |
| @@ -354,8 +358,9 @@ | ||
| 354 | 358 | return true; |
| 355 | 359 | } |
| 356 | 360 | |
| 357 | 361 | /** |
| 362 | + * @since 4.18.0 Keep the original error as the previous exception when the write fails. | |
| 358 | 363 | * @since 4.12.0 |
| 359 | 364 | * |
| 360 | 365 | * @throws Exception |
| 361 | 366 | */ |
| @@ -380,9 +385,9 @@ | ||
| 380 | 385 | DB::query('ROLLBACK'); |
| 381 | 386 | |
| 382 | 387 | Log::error('Failed untrashing a subscription', compact('subscription')); |
| 383 | 388 | |
| 384 | - throw new $exception('Failed untrashing a subscription'); | |
| 389 | + throw new Exception('Failed untrashing a subscription', 0, $exception); | |
| 385 | 390 | } |
| 386 | 391 | |
| 387 | 392 | DB::query('COMMIT'); |
| 388 | 393 | |
| @@ -416,8 +421,9 @@ | ||
| 416 | 421 | ]); |
| 417 | 422 | } |
| 418 | 423 | |
| 419 | 424 | /** |
| 425 | + * @since 4.18.0 Keep the original error as the previous exception when the write fails. | |
| 420 | 426 | * @since 2.19.6 |
| 421 | 427 | * |
| 422 | 428 | * @throws Exception |
| 423 | 429 | */ |
| @@ -439,9 +445,9 @@ | ||
| 439 | 445 | DB::query('ROLLBACK'); |
| 440 | 446 | |
| 441 | 447 | Log::error('Failed updating a subscription', compact('subscriptionId', 'columns')); |
| 442 | 448 | |
| 443 | - throw new $exception('Failed updating a subscription'); | |
| 449 | + throw new Exception('Failed updating a subscription', 0, $exception); | |
| 444 | 450 | } |
| 445 | 451 | |
| 446 | 452 | DB::query('COMMIT'); |
| 447 | 453 | |