<?php
namespace Docuform\Api\Exception;

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

class ApiHttpAlreadyExistsException extends HttpSpecializedException
{
  protected $code = 409;
  protected $message = 'Resource already exists.';
  protected string $title = '409 Resource Already Exists';
  protected string $description = 'The request could not be completed due to a conflict, because the given name already exists.';
  public function __construct(?ServerRequestInterface $request = null, ?string $message = null, ?string $description = null)
  {
    if ( $description )
      $this->description = $description;

    parent::__construct($request ? $request : new ServerRequest('', ''), $message, null);
  }
}

