-
-
08 Dec 2020 07:52:54 UTC
- Distribution: Dancer-Plugin-RPC
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (25 / 0 / 0)
- Kwalitee
Bus factor: 1- % Coverage
- License: perl_5
- Perl: v5.10.1
- Activity
24 month- Tools
- Download (38.7KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
++ed by:2 non-PAUSE users- Dependencies
- Dancer
- JSON
- Params::Validate
- Params::ValidationCompiler
- RPC::XML
- Time::HiRes
- Types::Standard
- YAML
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
- NAME
- SYNOPSIS
- DESCRIPTION
- COPYRIGHT
NAME
Dancer::RPCPlugin::ErrorResponse - Interface to pass error-responses without knowlage of the protocol
SYNOPSIS
use Dancer::RPCPlugin::ErrorResponse; sub handle_rpc_call { ... return error_response( error_code => 42, error_message => 'That went belly-up', ); }
DESCRIPTION
error_response(%parameters)
Factory function that retuns an instantiated Dancer::RPCPlugin::ErrorResponse.
Parameters
- error_code => $error_code [required]
- error_message => $error_message [required]
- error_data => $error_data [optional]
Responses
An instance or an exception from Params::ValidationCompiler.
register_error_responses($protocol => \%error_code_to_status_map)
register_error_responses( xmlrpc => { default => 200, } ) register_error_responses( restish => { default => 500, -32700 => 400, -32701 => 400, -32702 => 400, -32600 => 400, ... } );
Dancer::RPCPlugin::ErrorResponse->new(%parameters)
Parameters
- error_code => $error_code [required]
- error_message => $error_message [required]
- error_data => $error_data [optional]
Responses
An instance or an exception from Params::ValidationCompiler.
$er->return_status
Method that returns the HTTP status code from the map provided in
Dancer::RPCPlugin::ErrorResponse::register_error_responses()
$er->error_code
Getter for the
error_code
attribute.$er->error_message
Getter for the
error_message
attribute.$er->error_data
Getter for the
error_data
attribute.$er->as_jsonrpc_error
Returns a data-structure for the use in the
error
field of a jsonrpc response.$er->as_restrpc_error
Returns a data-structure like the
error-field
in a JSONRPC2 error response.$er->as_xmlrpc_fault
Returns a data-structure for the use as a
fault
response in XMLRPC.COPYRIGHT
(c) MMXVII - Abe Timmerman <abetim@cpan.org>
Module Install Instructions
To install Dancer::Plugin::RPC, copy and paste the appropriate command in to your terminal.
cpanm Dancer::Plugin::RPC
perl -MCPAN -e shell install Dancer::Plugin::RPC
For more information on module installation, please visit the detailed CPAN module installation guide.