1Net::Twitter::Lite::ErrUosre(r3pCmo)ntributed Perl DocumNeentt:a:tTiwointter::Lite::Error(3pm)
2
3
4
6 Net::Twitter::Lite::Error - Encapsulates errors thrown by
7 Net::Twitter::Lite
8
10 version 0.12008
11
13 use Net::Twitter::Lite;
14 my $nt = Net::Twitter::Lite->new;
15 my $r = eval { $nt->friends_timeline };
16 warn "$@\n" if $@;
17
19 Net::Twitter::Lite::Error encapsulates errors thrown by
20 "Net::Twitter::Lite". A "Net::Twitter::Lite::Error" object will
21 contain an "HTTP::Response", and a HASHREF containing Twitter API error
22 information if one was returned by Twitter.
23
25 new Constructs an "Net::Twitter::Lite::Error" object with an
26 HTTP::Response and optionally a Twitter error HASH ref. It takes
27 HASH of arguments. Examples:
28
29 my $e = Net::Twitter::Lite::Error->new(http_response => $res, twitter_error => $te);
30 my $e = Net::Twitter::Lite::Error->new(http_response => $res);
31
32 twitter_error
33 Get or set the encapsulated Twitter API error HASH ref.
34
35 http_response
36 Get or set the encapsulated HTTP::Response instance.
37
38 code
39 Returns the HTTP Status Code from the encapsulated HTTP::Response
40
41 message
42 Returns the HTTP Status Message from the encapsulated
43 HTTP::Response
44
45 error
46 Returns an error message as a string. The message be the "error"
47 element of the encapsulated Twitter API HASH ref, if there is one.
48 Otherwise it will return a string containing the HTTP Status Code
49 and Message. If the "Net::Twitter::Lite::Error" instance does not
50 contain either an HTTP::Response or a Twitter Error HASH ref, or
51 the HTTP::Response has no status code or message, "error" returns
52 the string '[unknown]'.
53
54 A Net::Twitter::Lite::Error stringifies to the "error" message.
55
57 Net::Twitter::Lite
58
60 Marc Mims <marc@questright.com>
61
63 This module is free software; you can redistribute it and/or modify it
64 under the same terms as Perl itself. See perlartistic.
65
66
67
68perl v5.34.0 2022-01-21 Net::Twitter::Lite::Error(3pm)