mirror of
https://github.com/standardebooks/web.git
synced 2025-07-13 18:11:52 -04:00
Use new duplicate key exception instead of checking PDOException
This commit is contained in:
parent
5ee7e8e2ad
commit
49f5bc7641
4 changed files with 14 additions and 29 deletions
|
@ -63,14 +63,8 @@ class Payment extends Accessor{
|
|||
?)
|
||||
', [$this->UserId, $this->Created, $this->ChannelId, $this->TransactionId, $this->Amount, $this->Fee, $this->IsRecurring, $this->IsMatchingDonation]);
|
||||
}
|
||||
catch(PDOException $ex){
|
||||
if(($ex->errorInfo[1] ?? 0) == 1062){
|
||||
// Duplicate unique key; transction ID already exists
|
||||
throw new Exceptions\PaymentExistsException();
|
||||
}
|
||||
else{
|
||||
throw $ex;
|
||||
}
|
||||
catch(Exceptions\DuplicateDatabaseKeyException){
|
||||
throw new Exceptions\PaymentExistsException();
|
||||
}
|
||||
|
||||
$this->PaymentId = Db::GetLastInsertedId();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue