Dancer2::RPCPlugin::ErrorResponse - Interface to pass error-responses without knowlage of the protocol
use Dancer2::RPCPlugin::ErrorResponse; sub handle_rpc_call { ... return error_response( error_code => 42, error_message => 'That went belly-up', ); }
Factory function that retuns an instantiated Dancer2::RPCPlugin::ErrorResponse.
An instance or an exception from Moo.
This method makes it posible to extend the RPC-plugin system with ones own error handlers.
Positional:
One the registered RPC-plugins.
A hashref with a mapping between error-codes produced by this RPC-prototcol and the HTTP-return status codes. There is a special code value default that is used for unregistered error-codes.
default
This is the name of the error handler one wants to add to this class.
This is a CodeRef for the error handler one wants to add for the new RPC-protocol.
CodeRef
Getter for the error_code attribute.
error_code
Getter for the error_message attribute.
error_message
Getter for the error_data attribute.
error_data
Returns the HTTP return status code for this error-code.
Returns a data-structure for the use in the error field of a jsonrpc response.
error
Returns a data-structure for the use as a fault response in XMLRPC.
fault
Returns a data-structure like the error-field in a JSONRPC2 error response.
error-field
(c) MMXVII - Abe Timmerman <abetim@cpan.org>
To install Dancer2::Plugin::RPC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer2::Plugin::RPC
CPAN shell
perl -MCPAN -e shell install Dancer2::Plugin::RPC
For more information on module installation, please visit the detailed CPAN module installation guide.