You are here

public static function Error::internalError in JSON-RPC 8

Same name and namespace in other branches
  1. 2.x src/Object/Error.php \Drupal\jsonrpc\Object\Error::internalError()

Constructs a new internal error.

Parameters

mixed $data: More specific information about the error.

\Drupal\Core\Cache\CacheableDependencyInterface $cacheability: (optional) A cacheable dependency.

Return value

static

2 calls to Error::internalError()
AddPermissionToRole::execute in modules/jsonrpc_core/src/Plugin/jsonrpc/Method/AddPermissionToRole.php
Executes the action with the parameters passed in.
JsonRpcException::fromPrevious in src/Exception/JsonRpcException.php
Constructs a JsonRpcException from an arbitrary exception.

File

src/Object/Error.php, line 190

Class

Error
Error class to help implement JSON RPC's spec for errors.

Namespace

Drupal\jsonrpc\Object

Code

public static function internalError($data = NULL, CacheableDependencyInterface $cacheability = NULL) {
  return new static(static::INTERNAL_ERROR, static::$errorMessages[static::INTERNAL_ERROR], $data ?: static::$errorMeanings[static::INTERNAL_ERROR], $cacheability);
}