.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Net::Twitter::Role::WrapError 3pm" .TH Net::Twitter::Role::WrapError 3pm "2022-06-16" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Net::Twitter::Role::WrapError \- Wraps Net::Twitter exceptions .SH "VERSION" .IX Header "VERSION" version 4.01043 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Net::Twitter; \& \& my $nt = Net::Twitter\->new(username => $username, password => $password); \& \& my $followers = $nt\->followers; \& if ( !followers ) { \& warn $nt\->http_message; \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides an alternate error handling strategy for \f(CW\*(C`Net::Twitter\*(C'\fR. Rather than throwing exceptions, \s-1API\s0 methods return \f(CW\*(C`undef\*(C'\fR and error information is available through method calls on the \f(CW\*(C`Net::Twitter\*(C'\fR object. .PP This is the error handling strategy used when \f(CW\*(C`trait\*(C'\fR \f(CW\*(C`Legacy\*(C'\fR is used. It was the error handling strategy employed by \f(CW\*(C`Net::Twitter\*(C'\fR prior to version 3.00. .SH "METHODS" .IX Header "METHODS" .IP "new" 4 .IX Item "new" This method takes the same parameters as \*(L"new\*(R" in Net::Twitter. .IP "get_error" 4 .IX Item "get_error" Returns undef if there was no error or a \s-1HASH\s0 ref containing the Twitter error response. Occasionally, a Twitter \s-1API\s0 call results in an error with no error content returned from Twitter. When that occurs, get_error returns a simulated error \s-1HASH\s0 ref. .Sp \&\s-1NOTE:\s0 Versions of \f(CW\*(C`Net::Twitter\*(C'\fR prior to 3.0 sometimes returned a string rather than a \s-1HASH\s0 ref, on error. This was a bug. Always expect undef on success and a \s-1HASH\s0 ref on error. .IP "http_code" 4 .IX Item "http_code" Returns the \s-1HTTP\s0 response code the most recent \s-1API\s0 method call if it ended in error. .IP "http_message" 4 .IX Item "http_message" Returns the \s-1HTTP\s0 message for the most recent \s-1API\s0 method call if it ended in error. .SH "SEE ALSO" .IX Header "SEE ALSO" Net::Twitter .SH "AUTHOR" .IX Header "AUTHOR" Marc Mims .SH "LICENSE" .IX Header "LICENSE" Copyright (c) 2016 Marc Mims .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "DISCLAIMER OF WARRANTY" .IX Header "DISCLAIMER OF WARRANTY" \&\s-1BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE \*(L"AS IS\*(R" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.\s0 .PP \&\s-1IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE\s0 (\s-1INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE\s0), \s-1EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\s0