-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: melhora tacada de exceções para módulo de usuários
- Loading branch information
1 parent
5200695
commit 299d409
Showing
5 changed files
with
119 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace App\Exceptions; | ||
|
||
use Symfony\Component\HttpFoundation\Response as ResponseAlias; | ||
|
||
class InvalidCredentialsException extends AbstractException | ||
{ | ||
public function __construct( | ||
array $contextualData, | ||
?int $code = ResponseAlias::HTTP_BAD_REQUEST, | ||
) { | ||
$message = 'Credenciais inválidas'; | ||
$debugMessage = "Credenciais inválidas ao logar"; | ||
$type = 'InvalidCredentialsException'; | ||
parent::__construct( | ||
$type, | ||
$contextualData, | ||
$message, | ||
$debugMessage, | ||
$code, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace App\Exceptions; | ||
|
||
use Symfony\Component\HttpFoundation\Response as ResponseAlias; | ||
|
||
class UniqueConstraintExistsException extends AbstractException | ||
{ | ||
public function __construct( | ||
string $message, | ||
array $contextualData, | ||
?int $code = ResponseAlias::HTTP_UNPROCESSABLE_ENTITY, | ||
) { | ||
$debugMessage = $message; | ||
$type = 'PayeeNotFoundException'; | ||
parent::__construct( | ||
$type, | ||
$contextualData, | ||
$message, | ||
$debugMessage, | ||
$code, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters