feat(exceptions): add NotFoundException for entity handling
Introduces a NotFoundException to standardize error handling for missing entities.
This commit is contained in:
parent
61bde4baaa
commit
6ba04fe009
7 changed files with 8 additions and 8 deletions
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Domain\Exceptions;
|
||||
namespace Application\Exceptions;
|
||||
|
||||
final class NotFoundException extends \DomainException
|
||||
final class NotFoundException extends \RuntimeException
|
||||
{
|
||||
public static function forEntity(string $entity, string $id): self
|
||||
{
|
||||
|
|
@ -4,7 +4,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Application\Usecase\Employees\Find;
|
||||
|
||||
use Domain\Exceptions\NotFoundException;
|
||||
use Application\Exceptions\NotFoundException;
|
||||
use Domain\Ports\Directories\EmployeeDirectory;
|
||||
use Shared\DDD\Usecase\Input as BaseInput;
|
||||
use Shared\DDD\Usecase\Usecase;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Presentation\Api\V1\Exceptions;
|
||||
|
||||
use Domain\Exceptions\NotFoundException;
|
||||
use Application\Exceptions\NotFoundException;
|
||||
use Illuminate\Http\Exceptions\ThrottleRequestsException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Presentation\Web\Exceptions;
|
||||
|
||||
use Domain\Exceptions\NotFoundException;
|
||||
use Application\Exceptions\NotFoundException;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Throwable;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Tests\Integration\Presentation\Api;
|
||||
|
||||
use Domain\Exceptions\NotFoundException;
|
||||
use Application\Exceptions\NotFoundException;
|
||||
use Illuminate\Http\Request;
|
||||
use Presentation\Api\Exceptions\ApiExceptionDispatcher;
|
||||
use Presentation\Api\V1\Exceptions\ApiExceptionRenderer as V1ApiExceptionRenderer;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Tests\Integration\Presentation\Api\V1;
|
||||
|
||||
use Domain\Exceptions\NotFoundException;
|
||||
use Application\Exceptions\NotFoundException;
|
||||
use Illuminate\Http\Exceptions\ThrottleRequestsException;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Tests\Integration\Presentation\Web;
|
||||
|
||||
use Domain\Exceptions\NotFoundException;
|
||||
use Application\Exceptions\NotFoundException;
|
||||
use Illuminate\Http\Request;
|
||||
use Presentation\Web\Exceptions\WebExceptionRenderer;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue