You are here

public function UploadException::getErrorResponse in Plupload integration 8

Same name and namespace in other branches
  1. 2.0.x src/UploadException.php \Drupal\plupload\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 67

Class

UploadException
Plupload exception handling route.

Namespace

Drupal\plupload

Code

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