Skip to content

Commit

Permalink
Improve exception messages
Browse files Browse the repository at this point in the history
This commit disambiguates the exception messages when getting a
donation. When a donation can be loaded but the conversion to a domain
object fails, the message no longer reads "could not get donation" (that
would hint at the donation not being in the database).

Ticket: https://phabricator.wikimedia.org/T375196
  • Loading branch information
gbirke committed Oct 21, 2024
1 parent 11b010f commit 63c5daa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DataAccess/DoctrineDonationRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function getDonationById( int $id ): ?Donation {
try {
return $converter->createFromLegacyObject( $doctrineDonation );
} catch ( \InvalidArgumentException $ex ) {
throw new GetDonationException( $ex, "Could not get donation with id '$id'" );
throw new GetDonationException( $ex, "Could not convert donation with id '$id' - " . $ex->getMessage() );
}
}
}

0 comments on commit 63c5daa

Please sign in to comment.