JSON::RPC::Common::Procedure::Return::Error - Base class for JSON-RPC errors


JSON-RPC-Common documentation  | view source Contained in the JSON-RPC-Common distribution.

Index


NAME

Top

JSON::RPC::Common::Procedure::Return::Error - Base class for JSON-RPC errors

VERSION

Top

version 0.10

SYNOPSIS

Top

	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;

DESCRIPTION

Top

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

ATTRIBUTES

Top

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

Top

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.

AUTHOR

Top

Yuval Kogman <nothingmuch@woobling.org>

COPYRIGHT AND LICENSE

Top


JSON-RPC-Common documentation  | view source Contained in the JSON-RPC-Common distribution.