eZ\Publish\Core\REST\Client\Exceptions\ServerException::__construct PHP Method

__construct() public method

public __construct ( ErrorMessage $error )
$error eZ\Publish\Core\REST\Client\Values\ErrorMessage
    public function __construct(ErrorMessage $error)
    {
        // Use description, this is the exception message from sever, message is only the HTTP status message.
        parent::__construct($error->description, $error->code);
        // These are only set if server is running in debug mode, but even if not set we want to overwrite the values.
        $this->file = (string) $error->file;
        $this->line = (int) $error->line;
        $this->trace = explode("\n", (string) $error->trace);
    }
ServerException