| @@ -110,8 +110,9 @@ | ||
| 110 | 110 | return array_column($additionalEmails, 'email'); |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /** |
| 114 | + * @since 4.18.0 Keep the original error as the previous exception when the write fails. | |
| 114 | 115 | * @since 3.20.0 store meta using native WP functions |
| 115 | 116 | * @since 3.7.0 Add support to "phone" property |
| 116 | 117 | * @since 2.24.0 add support for $donor->totalAmountDonated and $donor->totalNumberOfDonation |
| 117 | 118 | * @since 2.21.0 add actions givewp_donor_creating and givewp_donor_created |
| @@ -173,9 +174,9 @@ | ||
| 173 | 174 | DB::query('ROLLBACK'); |
| 174 | 175 | |
| 175 | 176 | Log::error('Failed creating a donor', compact('donor')); |
| 176 | 177 | |
| 177 | - throw new $exception('Failed creating a donor'); | |
| 178 | + throw new Exception('Failed creating a donor', 0, $exception); | |
| 178 | 179 | } |
| 179 | 180 | |
| 180 | 181 | DB::query('COMMIT'); |
| 181 | 182 | |
| @@ -249,8 +250,9 @@ | ||
| 249 | 250 | Hooks::doAction('givewp_donor_updated', $donor); |
| 250 | 251 | } |
| 251 | 252 | |
| 252 | 253 | /** |
| 254 | + * @since 4.18.0 Keep the original error as the previous exception when the write fails. | |
| 253 | 255 | * @since 2.19.6 |
| 254 | 256 | * |
| 255 | 257 | * @throws Exception |
| 256 | 258 | */ |
| @@ -272,9 +274,9 @@ | ||
| 272 | 274 | DB::query('ROLLBACK'); |
| 273 | 275 | |
| 274 | 276 | Log::error('Failed updating a donor', compact('donorId', 'columns')); |
| 275 | 277 | |
| 276 | - throw new $exception('Failed updating a donor'); | |
| 278 | + throw new Exception('Failed updating a donor', 0, $exception); | |
| 277 | 279 | } |
| 278 | 280 | |
| 279 | 281 | DB::query('COMMIT'); |
| 280 | 282 | |
| @@ -282,8 +284,9 @@ | ||
| 282 | 284 | } |
| 283 | 285 | |
| 284 | 286 | /** |
| 285 | 287 | * |
| 288 | + * @since 4.18.0 Keep the original error as the previous exception when the write fails. | |
| 286 | 289 | * @since 2.21.0 add actions givewp_donor_deleting and givewp_donor_deleted |
| 287 | 290 | * @since 2.20.0 consolidate meta deletion into a single query |
| 288 | 291 | * @since 2.19.6 |
| 289 | 292 | * |
| @@ -307,9 +310,9 @@ | ||
| 307 | 310 | DB::query('ROLLBACK'); |
| 308 | 311 | |
| 309 | 312 | Log::error('Failed deleting a donor', compact('donor')); |
| 310 | 313 | |
| 311 | - throw new $exception('Failed deleting a donor'); | |
| 314 | + throw new Exception('Failed deleting a donor', 0, $exception); | |
| 312 | 315 | } |
| 313 | 316 | |
| 314 | 317 | DB::query('COMMIT'); |
| 315 | 318 | |