mirror of
https://github.com/standardebooks/web.git
synced 2025-07-08 07:40:39 -04:00
Rename exception for consistency
This commit is contained in:
parent
94d62fdcdf
commit
c36d1ac3d3
4 changed files with 10 additions and 10 deletions
|
@ -1550,7 +1550,7 @@ final class Ebook{
|
|||
|
||||
/**
|
||||
* @throws Exceptions\InvalidEbookException
|
||||
* @throws Exceptions\DuplicateEbookException
|
||||
* @throws Exceptions\EbookExistsException
|
||||
*/
|
||||
public function CreateOrUpdate(): void{
|
||||
try{
|
||||
|
@ -1838,14 +1838,14 @@ final class Ebook{
|
|||
|
||||
/**
|
||||
* @throws Exceptions\InvalidEbookException
|
||||
* @throws Exceptions\DuplicateEbookException If an `Ebook` with the given identifier already exists.
|
||||
* @throws Exceptions\EbookExistsException If an `Ebook` with the given identifier already exists.
|
||||
*/
|
||||
public function Create(): void{
|
||||
$this->Validate();
|
||||
|
||||
try{
|
||||
Ebook::GetByIdentifier($this->Identifier);
|
||||
throw new Exceptions\DuplicateEbookException($this->Identifier);
|
||||
throw new Exceptions\EbookExistsException($this->Identifier);
|
||||
}
|
||||
catch(Exceptions\EbookNotFoundException){
|
||||
// Pass.
|
||||
|
@ -1917,7 +1917,7 @@ final class Ebook{
|
|||
|
||||
/**
|
||||
* @throws Exceptions\InvalidEbookException If the `Ebook` is invalid.
|
||||
* @throws Exceptions\DuplicateEbookException If an `Ebook` with the same title and author already exists.
|
||||
* @throws Exceptions\EbookExistsException If an `Ebook` with the same title and author already exists.
|
||||
*/
|
||||
public function Save(): void{
|
||||
$this->Validate();
|
||||
|
@ -1970,7 +1970,7 @@ final class Ebook{
|
|||
$this->EbookId]);
|
||||
}
|
||||
catch(Exceptions\DuplicateDatabaseKeyException){
|
||||
throw new Exceptions\DuplicateEbookException($this->Identifier);
|
||||
throw new Exceptions\EbookExistsException($this->Identifier);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue