PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.18.0
GiveWP – Donation Plugin and Fundraising Platform v4.18.0
4.18.0 4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 All 257 releases
← All changes | src/Donations/Repositories/DonationNotesRepository.php +6 -3 4.15.4 → 4.18.0 View file →
@@ -43,8 +43,9 @@
43 43 ->get();
44 44 }
45 45
46 46 /**
47 + * @since 4.18.0 Keep the original error as the previous exception when the write fails.
47 48 * @since 2.21.0
48 49 *
49 50 * @param DonationNote $donationNote
50 51 *
@@ -90,9 +91,9 @@
90 91 DB::query('ROLLBACK');
91 92
92 93 Log::error('Failed creating a donation note', compact('donationNote'));
93 94
94 - throw new $exception('Failed creating a donation note');
95 + throw new Exception('Failed creating a donation note', 0, $exception);
95 96 }
96 97
97 98 DB::query('COMMIT');
98 99
@@ -102,8 +103,9 @@
102 103 Hooks::doAction('givewp_donation_note_created', $donationNote);
103 104 }
104 105
105 106 /**
107 + * @since 4.18.0 Keep the original error as the previous exception when the write fails.
106 108 * @since 2.21.0
107 109 *
108 110 * @param DonationNote $donationNote
109 111 *
@@ -133,9 +135,9 @@
133 135 DB::query('ROLLBACK');
134 136
135 137 Log::error('Failed updating a donation note', compact('donationNote'));
136 138
137 - throw new $exception('Failed updating a donation note');
139 + throw new Exception('Failed updating a donation note', 0, $exception);
138 140 }
139 141
140 142 DB::query('COMMIT');
141 143
@@ -142,8 +144,9 @@
142 144 Hooks::doAction('givewp_donation_note_updated', $donationNote);
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 2.21.0
147 150 *
148 151 * @param DonationNote $donationNote
149 152 *
@@ -168,9 +171,9 @@
168 171 DB::query('ROLLBACK');
169 172
170 173 Log::error('Failed deleting a donation note', compact('donationNote'));
171 174
172 - throw new $exception('Failed deleting a donation note');
175 + throw new Exception('Failed deleting a donation note', 0, $exception);
173 176 }
174 177
175 178 DB::query('COMMIT');
176 179