Skip to content

Commit

Permalink
Reorganizing Exceptions Namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
rotimi committed Feb 4, 2024
1 parent 2d47c56 commit 5770516
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/LeanOrm/Exceptions/RelatedModelNotCreatedException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php
declare(strict_types=1);
namespace LeanOrm\Exceptions;

class RelatedModelNotCreatedException extends \Exception{}
8 changes: 4 additions & 4 deletions src/LeanOrm/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -1260,15 +1260,15 @@ protected function createRelatedModelObject(
. " associated with the foreign table class '{$f_models_class_name}'."
. PHP_EOL . static::class . '::' . __FUNCTION__ . '(...).'
. PHP_EOL;
throw new RelatedModelNotCreatedException($msg);
throw new \LeanOrm\Exceptions\RelatedModelNotCreatedException($msg);

} catch (\GDAO\ModelTableNameNotSetDuringConstructionException) {

$msg = "ERROR: Couldn't create foreign model of type '{$f_models_class_name}'."
. " No database table name supplied."
. PHP_EOL . static::class . '::' . __FUNCTION__ . '(...).'
. PHP_EOL;
throw new RelatedModelNotCreatedException($msg);
throw new \LeanOrm\Exceptions\RelatedModelNotCreatedException($msg);

} catch (\LeanOrm\Exceptions\BadModelTableNameException) {

Expand All @@ -1277,7 +1277,7 @@ protected function createRelatedModelObject(
. " view in the database."
. PHP_EOL . static::class . '::' . __FUNCTION__ . '(...).'
. PHP_EOL;
throw new RelatedModelNotCreatedException($msg);
throw new \LeanOrm\Exceptions\RelatedModelNotCreatedException($msg);

} catch(\LeanOrm\Exceptions\BadModelPrimaryColumnNameException) {

Expand All @@ -1286,7 +1286,7 @@ protected function createRelatedModelObject(
. " does not exist in the supplied table named `{$f_table_name}`."
. PHP_EOL . static::class . '::' . __FUNCTION__ . '(...).'
. PHP_EOL;
throw new RelatedModelNotCreatedException($msg);
throw new \LeanOrm\Exceptions\RelatedModelNotCreatedException($msg);
}

if($this->canLogQueries()) {
Expand Down

0 comments on commit 5770516

Please sign in to comment.