Net::T...apError(3pm)
π Net::Twitter::Role::WrapError(3pm) β bestie edition π
okay so real quick: this is the Net::Twitter::Role::WrapError page from the User Contributed Perl Documentation, and the header up top is being all dramatic and truncated, showing up as Net::T...apError(3pm) like it's too iconic for a full name. we know the truth tho π«Ά
β¨ NAME β¨
Net::Twitter::Role::WrapError β it wraps Net::Twitter exceptions π like a lil protective blanket for your error handling
π VERSION π
version 4.01043 π
πΈ SYNOPSIS πΈ
here's the vibe, copy-paste coded exactly as-is:
use Net::Twitter;
my $nt = Net::Twitter->new(username => $username, password => $password);
my $followers = $nt->followers;
if ( !followers ) {
warn $nt->http_message;
}
see how we're checking !followers instead of catching a throw? that's the whole personality of this module. no cap β¨
π¦ DESCRIPTION π¦
so this module gives Net::Twitter an alternate error handling strategy, bestie. instead of throwing exceptions all over the place (so messy π), the API methods just return undef, and all the error tea is available through method calls on the Net::Twitter object. it's giving "quietly hands you the receipts instead of screaming in the group chat" π
this is the error handling strategy you get when the trait Legacy is used. and fun fact: it was literally the error handling strategy Net::Twitter employed prior to version 3.00 β so yeah, it's the OG, the blueprint, the moment before the glow-up π
π METHODS π
newβ this method takes the same parameters asnewin Net::Twitter. same energy, same args, no surprises π«Άget_errorβ returnsundefif there was no error, or aHASHref containing the Twitter error response. and here's a lil edge case for you: occasionally a Twitter API call results in an error with no error content returned from Twitter. when that happens?get_errorreturns a simulated errorHASHref. it's making one up. it's improvising. iconic behavior honestly π
NOTE: versions ofNet::Twitterprior to3.0sometimes returned a string rather than aHASHref, on error. this was a bug. always expectundefon success and aHASHref on error. periodt π
http_codeβ returns the HTTP response code of the most recent API method call, if it ended in error. (if it didn't end in error... nothing, bestie, it's just vibes) πhttp_messageβ returns the HTTP message for the most recent API method call if it ended in error. this is the one yourwarncall wants π£οΈ
π SEE ALSO π
Net::Twitter
π AUTHOR π
Marc Mims <marc@questright.com> β thank you for your service, king π«‘
π LICENSE π
Copyright (c) 2016 Marc Mims
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π
π DISCLAIMER OF WARRANTY π
okay bestie, this is the part where we get real serious, so buckle up. i'm keeping every single word's worth of meaning here, because this is legally binding and not the vibe to paraphrase:
BECAUSE 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 "AS IS" 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.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO 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 (INCLUDING 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), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
and that's the whole page, bestie!! π mwah π this lil beauty ships as perl v5.34.0, dated 2022-06-16 β go forth and wrap those errors, i'm obsessed with you πβ¨
π¦ where this page comes from
- debian bookworm: libnet-twitter-perl 4.01043-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libnet-twitter-perl 4.01043-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libnet-twitter-perl 4.01043-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms