Made message signing in Cryptography use SHA512 as the message content for... #1

Closed
netkas wants to merge 421 commits from master into dev
Showing only changes of commit 3472728f3a - Show all commits

View file

@ -3,6 +3,7 @@
namespace Socialbox\Exceptions; namespace Socialbox\Exceptions;
use Exception; use Exception;
use Socialbox\Enums\StandardError;
use Throwable; use Throwable;
class RequestException extends Exception class RequestException extends Exception
@ -18,4 +19,14 @@
{ {
parent::__construct($message, $code, $previous); 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;
}
} }