Skip to content

Commit

Permalink
πŸ› Us Throwable instead of Exception when trying to set selv
Browse files Browse the repository at this point in the history
  • Loading branch information
mschadegg committed Feb 26, 2024
1 parent 3cc478b commit f498d9e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Abstracts/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Morningtrain\Economic\Services\EconomicLoggerService;
use ReflectionAttribute;
use ReflectionClass;
use Throwable;

abstract class Resource implements JsonSerializable
{
Expand Down Expand Up @@ -217,7 +218,7 @@ public function toArray(bool $forApiRequest = false): array
if (empty($vars['self']) && ! empty($this->getPrimaryKey())) {
try {
$vars['self'] = EconomicApiService::createURL($this->getEndpoint(GetSingle::class, $this->getPrimaryKey()));
} catch (Exception $e) {
} catch (Throwable $e) {
// Do nothing, since we can't get the self
}
}
Expand Down

0 comments on commit f498d9e

Please sign in to comment.