Rename exception for consistency

This commit is contained in:
Alex Cabal 2025-01-09 14:08:54 -06:00
parent 94d62fdcdf
commit c36d1ac3d3
4 changed files with 10 additions and 10 deletions

View file

@ -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);
}