Skip to content

Commit

Permalink
Merge pull request #16 from fr3nch13/dev
Browse files Browse the repository at this point in the history
Better way as the catch was obfuscating the real error.
  • Loading branch information
fr3nch13 authored Jul 26, 2023
2 parents fa3ffae + 035bbfd commit 728524c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Model/Table/CheckAddTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ public function getNameField(): string
*/
public function checkAdd($name = null, $slug = null, $fields = [], $returnEntity = false)
{
try {
// @phpstan-ignore-next-line
$name = $this->fixName($name);
} catch (\Throwable $e) {
// @phpstan-ignore-next-line
if (!method_exists($this, 'fixName')) {
throw new MissingMethodException([self::class, 'fixName', '']);
}

$name = $this->fixName($name);

$save = false;
$new = false;

Expand Down

0 comments on commit 728524c

Please sign in to comment.