add domain exception classes
BadRequestException, UnauthorizedException, ForbiddenException - all extend DomainException. use cases throw these to signal HTTP 4xx categories; controllers translate to JsonResponse status codes (400, 401, 403).
This commit is contained in:
parent
c2ba02cc6f
commit
fb5f8d4f02
3 changed files with 21 additions and 0 deletions
7
backend/app/Exceptions/BadRequestException.php
Normal file
7
backend/app/Exceptions/BadRequestException.php
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use DomainException;
|
||||
|
||||
class BadRequestException extends DomainException {}
|
||||
7
backend/app/Exceptions/ForbiddenException.php
Normal file
7
backend/app/Exceptions/ForbiddenException.php
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use DomainException;
|
||||
|
||||
class ForbiddenException extends DomainException {}
|
||||
7
backend/app/Exceptions/UnauthorizedException.php
Normal file
7
backend/app/Exceptions/UnauthorizedException.php
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use DomainException;
|
||||
|
||||
class UnauthorizedException extends DomainException {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue