Made message signing in Cryptography use SHA512 as the message content for... #1
1 changed files with 11 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
namespace Socialbox\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Socialbox\Enums\StandardError;
|
||||
use Throwable;
|
||||
|
||||
class RequestException extends Exception
|
||||
|
@ -18,4 +19,14 @@
|
|||
{
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the standard error associated with the exception code.
|
||||
*
|
||||
* @return StandardError The standard error associated with the exception code.
|
||||
*/
|
||||
public function getStandardError(): StandardError
|
||||
{
|
||||
return StandardError::tryFrom($this->getCode()) ?? StandardError::UNKNOWN;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue