auth error translatable exception message
This commit is contained in:
@@ -29,8 +29,25 @@
|
||||
|
||||
namespace Espo\Core\Exceptions;
|
||||
|
||||
class ServiceUnavailable extends \Exception
|
||||
class ServiceUnavailable extends \Exception implements HasBody
|
||||
{
|
||||
/** @var int */
|
||||
protected $code = 503;
|
||||
private ?string $body = null;
|
||||
|
||||
/**
|
||||
* Create with a body (supposed to be sent to the frontend).
|
||||
*/
|
||||
public static function createWithBody(string $message, string $body): self
|
||||
{
|
||||
$exception = new static($message);
|
||||
$exception->body = $body;
|
||||
|
||||
return $exception;
|
||||
}
|
||||
|
||||
public function getBody(): ?string
|
||||
{
|
||||
return $this->body;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user