JSON::RPC::Common::Procedure::Return::Error(3pm)

JSON::RPC::Common::Procedure::Return::Error3pm

Base class for json-rpc errors

Usage

        use JSON::RPC::Common::Procedure::Return::Error;
        my $error = JSON::RPC::Common::Procedure::Return::Error->new(
                message => "foo",
                code => "bah",
        );
        # or construct a return with an error from a call:
        my $return = $call->return_error("foo");
        $return->error->message;

Version

version 0.11

Overview

This is a base class for all version specific error implementations.

Attributes

code
message
data

These are the three common JSON-RPC error fields. In JSON-RPC 1.1 "data" is known as "error", and in 1.0 none of this is specced at all.

See the version specific subclasses for various behaviors.

Code is an integer, and message is a string.

Methods

new_dwim

Convenience constructor used by "return_error" in JSON::RPC::Common::Procedure::Call.

Will return an object if that's the argument, and otherwise construct an error.

inflate

Create an error object from JSON data (not text).

In order to maximize compatibility this inflation routine is very liberal in what it accepts.

Releases

Unchanged in 3 releases since Debian 11 (Bullseye).

  1. 11–13

Author

Yuval Kogman <[email protected]>

From libjson-rpc-common-perl 0.11-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.