<?php
namespace Docuform\Api\Exception;

use Nyholm\Psr7\ServerRequest;
use Psr\Http\Message\ServerRequestInterface;
use Slim\Exception\HttpSpecializedException;
use Throwable;

class ApiHttpInvalidUserException extends HttpSpecializedException
{
  protected $code = 400;
  protected $message = 'User unauthorized.';
  protected string $title = '400 User unauthorized';
  public function __construct(?ServerRequestInterface $request = null, ?string $message = null, ?string $description = null, ?Throwable $previous = null)
  {
    if ($description != null)
      $this->description = $description;

    parent::__construct($request ? $request : new ServerRequest("",""), $message, $previous);
  }
}
