← All changes
|
src/Donors/Repositories/DonorNotesRepository.php
+6
-3
4.16.7.2
→
4.18.0
View file →
| @@ -38,8 +38,9 @@ | ||
| 38 | 38 | ->get(); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | + * @since 4.18.0 Keep the original error as the previous exception when the write fails. | |
| 42 | 43 | * @since 4.4.0 |
| 43 | 44 | * |
| 44 | 45 | * @throws Exception |
| 45 | 46 | */ |
| @@ -83,9 +84,9 @@ | ||
| 83 | 84 | DB::rollback(); |
| 84 | 85 | |
| 85 | 86 | Log::error('Failed creating a donor note', compact('donorNote')); |
| 86 | 87 | |
| 87 | - throw new $exception('Failed creating a donor note'); | |
| 88 | + throw new Exception('Failed creating a donor note', 0, $exception); | |
| 88 | 89 | } |
| 89 | 90 | |
| 90 | 91 | DB::commit(); |
| 91 | 92 | |
| @@ -95,8 +96,9 @@ | ||
| 95 | 96 | Hooks::doAction('givewp_donor_note_created', $donorNote); |
| 96 | 97 | } |
| 97 | 98 | |
| 98 | 99 | /** |
| 100 | + * @since 4.18.0 Keep the original error as the previous exception when the write fails. | |
| 99 | 101 | * @since 4.4.0 |
| 100 | 102 | * |
| 101 | 103 | * @throws Exception |
| 102 | 104 | */ |
| @@ -123,9 +125,9 @@ | ||
| 123 | 125 | DB::rollback(); |
| 124 | 126 | |
| 125 | 127 | Log::error('Failed updating a donor note', compact('donorNote')); |
| 126 | 128 | |
| 127 | - throw new $exception('Failed updating a donor note'); | |
| 129 | + throw new Exception('Failed updating a donor note', 0, $exception); | |
| 128 | 130 | } |
| 129 | 131 | |
| 130 | 132 | DB::commit(); |
| 131 | 133 | |
| @@ -132,8 +134,9 @@ | ||
| 132 | 134 | Hooks::doAction('givewp_donor_note_updated', $donorNote); |
| 133 | 135 | } |
| 134 | 136 | |
| 135 | 137 | /** |
| 138 | + * @since 4.18.0 Keep the original error as the previous exception when the write fails. | |
| 136 | 139 | * @since 4.4.0 |
| 137 | 140 | * |
| 138 | 141 | * @throws Exception |
| 139 | 142 | */ |
| @@ -155,9 +158,9 @@ | ||
| 155 | 158 | DB::rollback(); |
| 156 | 159 | |
| 157 | 160 | Log::error('Failed deleting a donor note', compact('donorNote')); |
| 158 | 161 | |
| 159 | - throw new $exception('Failed deleting a donor note'); | |
| 162 | + throw new Exception('Failed deleting a donor note', 0, $exception); | |
| 160 | 163 | } |
| 161 | 164 | |
| 162 | 165 | DB::commit(); |
| 163 | 166 | |