Error::Pure::JSON::Advance - Error::Pure module for JSON output with additional parameters.
use Error::Pure::JSON::Advance qw(err); err 'This is a fatal error', 'name', 'value';
Process error in JSON format with messages @messages. Output affects $Error::Pure::Output::JSON::PRETTY variable.
# Pragmas. use strict; use warnings; # Modules. use Error::Pure::JSON::Advance qw(err); # Additional parameters. %Error::Pure::JSON::Advance::ERR_PARAMETERS = ( 'status' => 1, 'message' => 'Foo bar', ); # Error. err '1'; # Output like: # {"status":1,"error-pure":[{"msg":["1"],"stack":[{"sub":"err","prog":"example1.pl","args":"(1)","class":"main","line":17}]}],"message":"Foo bar"}
# Pragmas. use strict; use warnings; # Modules. use Error::Pure::JSON::Advance qw(err); # Additional parameters. %Error::Pure::JSON::Advance::ERR_PARAMETERS = ( 'status' => 1, 'message' => 'Foo bar', ); # Error. err '1', '2', '3'; # Output like: # {"status":1,"error-pure":[{"msg":["1","2","3"],"stack":[{"sub":"err","prog":"example2.pl","args":"(1, 2, 3)","class":"main","line":17}]}],"message":"Foo bar"}
# Pragmas. use strict; use warnings; # Modules. use Error::Pure::Output::JSON; use Error::Pure::JSON::Advance qw(err); # Additional parameters. %Error::Pure::JSON::Advance::ERR_PARAMETERS = ( 'status' => 1, 'message' => 'Foo bar', ); # Pretty print. $Error::Pure::Output::JSON::PRETTY = 1; # Error. err '1'; # Output like: # { # "status" : 1, # "error-pure" : [ # { # "msg" : [ # "1" # ], # "stack" : [ # { # "sub" : "err", # "prog" : "example3.pl", # "args" : "(1)", # "class" : "main", # "line" : 21 # } # ] # } # ], # "message" : "Foo bar" # }
Error::Pure::Utils, Error::Pure::Output::JSON, Exporter, List::MoreUtils, Readonly.
Error::Pure, Error::Pure::AllError, Error::Pure::Always, Error::Pure::Die, Error::Pure::Error, Error::Pure::ErrorList, Error::Pure::HTTP::AllError, Error::Pure::HTTP::Error, Error::Pure::HTTP::ErrorList, Error::Pure::HTTP::JSON, Error::Pure::HTTP::Print, Error::Pure::JSON, Error::Pure::NoDie, Error::Pure::Output::JSON, Error::Pure::Output::Text, Error::Pure::Utils.
https://github.com/tupinek/Error-Pure-JSON
Michal Špaček mailto:skim@cpan.org
http://skim.cz
BSD license.
0.03
To install Error::Pure::JSON, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Error::Pure::JSON
CPAN shell
perl -MCPAN -e shell install Error::Pure::JSON
For more information on module installation, please visit the detailed CPAN module installation guide.