NAME

Catalyst::Plugin::JSONRPC::Server::Error - a structured JSON-RPC error

DESCRIPTION

A handler may throw one of these to return a specific JSON-RPC error from Catalyst::Plugin::JSONRPC::Server::Dispatcher.

ATTRIBUTES

code

Required. The JSON-RPC error code (an integer). The spec reserves -32768 through -32000 for pre-defined errors, of which -32099 through -32000 are set aside for implementation-defined server errors. Codes outside the reserved block are free for application-defined errors.

message

Required. A short, single-sentence description of the error.

data

Optional. Any additional information about the error, as a JSON-serializable value. Omitted from the response envelope entirely when not set.

METHODS

throw( code => $n, message => $str, data => $any )

Convenience constructor that dies a new instance.