NAME

Beekeeper::JSONRPC::Error - Representation of a JSON-RPC error.

VERSION

Version 0.01

SYNOPSIS

my $client = Beekeeper::Client->instance;

my $resp = $client->do_job(
    method => 'myapp.svc.foo',
    params => { foo => 'bar' },
);

unless ($resp->success) {
    # Error response
    die $resp->code . $resp->message;
}

DESCRIPTION

Objects of this class represents a JSON-RPC error (see http://www.jsonrpc.org/specification).

When a RPC call could not be executed successfully the worker replies with a Beekeeper::JSONRPC::Error object. These objects may be returned also due to client side errors, like network disconnections or timeouts.

Method Beekeeper::Client-\do_job> returns objects of this class on failure.

ACCESSORS

message

A string providing a short description of the error.

code

A number that indicates the error type that occurred.

data

Arbitrary value or data structure containing additional information about the error. This may be present or not.

id

The id of the request it is responding to. It is unique per client connection, and it is used for response matching.

success

Always returns false. Used to determine if a method was executed successfully or not ($response->result cannot be trusted as it may be undefined on success).

Predefined errors

Error codes from and including -32768 to -32000 are reserved for predefined errors of the JSON-RPC spec.

AUTHOR

José Micó, jose.mico@gmail.com

COPYRIGHT AND LICENSE

Copyright 2015 José Micó.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language itself.

This software is distributed in the hope that it will be useful, but it is provided “as is” and without any express or implied warranties. For details, see the full text of the license in the file LICENSE.