NAME
Perinci::Sub::Property::dies_on_error - Die on non-success result
VERSION
This document describes version 0.07 of Perinci::Sub::Property::dies_on_error (from Perl distribution Perinci-Sub-Property-dies_on_error), released on 2016-05-11.
SYNOPSIS
Without dies_on_error:
# on successful call
f(...); # [200, "OK"]
# on non-successful call
f(...); # [404, "Not found"]
With dies_on_error => 1
:
# on successful call
f(...); # [200, "OK"]
# on non-successful call
f(...); # dies with message "Call f() failed with 404 status: Not found"
To customize what statuses are considered error: dies_on_error => { success_statuses => '^2..$' }
.
DESCRIPTION
This property sets so that function dies when result status is a non-successful one (it even dies under wrapping option trap=>1). Successful statuses by default include 2xx and 304 ('^(2..|304)$'
).
HOMEPAGE
Please visit the project's homepage at https://metacpan.org/release/Perinci-Sub-Property-dies_on_error.
SOURCE
Source repository is at https://github.com/perlancar/perl-Perinci-Sub-Property-dies_on_error.
BUGS
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Perinci-Sub-Property-dies_on_error
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
SEE ALSO
AUTHOR
perlancar <perlancar@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2016 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.