You are here

public function UploadException::getErrorResponse in DropzoneJS 8.2

Same name and namespace in other branches
  1. 8 src/UploadException.php \Drupal\dropzonejs\UploadException::getErrorResponse()

Generates and returns JSON response object for the error.

Return value

\Symfony\Component\HttpFoundation\JsonResponse JSON response object.

File

src/UploadException.php, line 75

Class

UploadException
Class UploadException.

Namespace

Drupal\dropzonejs

Code

public function getErrorResponse() {
  return new JsonResponse([
    'jsonrpc' => '2.0',
    'error' => $this->errorMessages[$this->code],
    'id' => 'id',
  ], 500);
}