← All changes
|
src/EventTickets/Repositories/EventRepository.php
+6
-3
4.16.7.1
→
4.18.0
View file →
| @@ -46,8 +46,9 @@ | ||
| 46 | 46 | ->where('id', $id); |
| 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 3.6.0 |
| 51 | 52 | * |
| 52 | 53 | * @throws Exception|InvalidArgumentException |
| 53 | 54 | */ |
| @@ -80,9 +81,9 @@ | ||
| 80 | 81 | DB::query('ROLLBACK'); |
| 81 | 82 | |
| 82 | 83 | Log::error('Failed creating an event', compact('event')); |
| 83 | 84 | |
| 84 | - throw new $exception('Failed creating an event'); | |
| 85 | + throw new Exception('Failed creating an event', 0, $exception); | |
| 85 | 86 | } |
| 86 | 87 | |
| 87 | 88 | $event->id = $eventId; |
| 88 | 89 | $event->createdAt = $createdDateTime; |
| @@ -93,8 +94,9 @@ | ||
| 93 | 94 | Hooks::doAction('givewp_events_event_created', $event); |
| 94 | 95 | } |
| 95 | 96 | |
| 96 | 97 | /** |
| 98 | + * @since 4.18.0 Keep the original error as the previous exception when the write fails. | |
| 97 | 99 | * @since 3.6.0 |
| 98 | 100 | * |
| 99 | 101 | * @throws Exception|InvalidArgumentException |
| 100 | 102 | */ |
| @@ -125,9 +127,9 @@ | ||
| 125 | 127 | DB::query('ROLLBACK'); |
| 126 | 128 | |
| 127 | 129 | Log::error('Failed updating an event', compact('event')); |
| 128 | 130 | |
| 129 | - throw new $exception('Failed updating an event'); | |
| 131 | + throw new Exception('Failed updating an event', 0, $exception); | |
| 130 | 132 | } |
| 131 | 133 | |
| 132 | 134 | $event->updatedAt = $updatedDateTime; |
| 133 | 135 | |
| @@ -136,8 +138,9 @@ | ||
| 136 | 138 | Hooks::doAction('givewp_events_event_updated', $event); |
| 137 | 139 | } |
| 138 | 140 | |
| 139 | 141 | /** |
| 142 | + * @since 4.18.0 Keep the original error as the previous exception when the write fails. | |
| 140 | 143 | * @since 3.6.0 |
| 141 | 144 | * |
| 142 | 145 | * @throws Exception |
| 143 | 146 | */ |
| @@ -155,9 +158,9 @@ | ||
| 155 | 158 | DB::query('ROLLBACK'); |
| 156 | 159 | |
| 157 | 160 | Log::error('Failed deleting an event', compact('event')); |
| 158 | 161 | |
| 159 | - throw new $exception('Failed deleting an event'); | |
| 162 | + throw new Exception('Failed deleting an event', 0, $exception); | |
| 160 | 163 | } |
| 161 | 164 | |
| 162 | 165 | DB::query('COMMIT'); |
| 163 | 166 | |