You are here

public static function JsonRpcException::fromError in JSON-RPC 8

Same name and namespace in other branches
  1. 2.x src/Exception/JsonRpcException.php \Drupal\jsonrpc\Exception\JsonRpcException::fromError()

Constructs a JsonRpcException from an arbitrary error object.

Parameters

\Drupal\jsonrpc\Object\Error $error: The error which caused the exception.

mixed $id: The request ID, if available.

string $version: (optional) The JSON-RPC version.

Return value

static

11 calls to JsonRpcException::fromError()
AddPermissionToRole::execute in modules/jsonrpc_core/src/Plugin/jsonrpc/Method/AddPermissionToRole.php
Executes the action with the parameters passed in.
EntityParameterFactory::doTransform in src/ParameterFactory/EntityParameterFactory.php
Handler::checkAccess in src/Handler.php
Check execution access.
Handler::doExecution in src/Handler.php
Gets an anonymous function which executes the RPC method.
Handler::getExecutable in src/Handler.php
Gets an executable instance of an RPC method.

... See full list

File

src/Exception/JsonRpcException.php, line 86

Class

JsonRpcException
Custom exception class for the module.

Namespace

Drupal\jsonrpc\Exception

Code

public static function fromError(Error $error, $id = FALSE, $version = NULL) {
  return new static(static::buildResponse($error, $id, $version));
}