lib/Finance/Robinhood/Error.pm

filter: Statementstmt 86.6% 13 / 15 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 60.0% 3 / 5 Podpod n/a totaltotal 69.5% 16 / 23 CC 2 SCAR 10.5
CC
2
Cov
76%
__ANON__
6.0
__ANON__
2.0
BEGIN
1.2
CRAP 2.9
« lib/Finance/Robinhood/Equity/Account/MarginBalances.pm ↑ Summary lib/Finance/Robinhood/User/InternationalInfo.pm »
1 package Finance::Robinhood::Error;
2  
3 =encoding utf-8
4  
5 =for stopwords watchlist watchlists untradable urls
6  
7 =head1 NAME
8  
9 Finance::Robinhood::Error - What You Find When Things Go Wrong
10  
11 =head1 SYNOPSIS
12  
13 use Finance::Robinhood;
14  
15 my $rh = Finance::Robinhood->new->login( 'timbob35', 'hunter3' ); # Wrong password
16 $rh || die $rh; # false value is retured; stringify it as a fatal error
17  
18 =head1 DESCRIPTION
19  
20 When this distribution has trouble with anything, this is returned.
21  
22 Error objects evaluate to untrue values.
23  
24 Error objects stringify to the contents of C<detail( )> or 'Unknown error.'
25  
26 =head1 METHODS
27  
28 =cut
29  
30 1 our $VERSION = '0.92_003';
31 1 ▶use Mojo::Base-base, -signatures;
Subroutine BEGIN: called CC=1 SCAR=0.0
32 1 ▶use Mojo::URL;
Subroutine BEGIN: called CC=1 SCAR=0.0
33 0 ▶use overload 'bool' => sub ($s, @) {0},
Subroutine BEGIN: called CC=1 SCAR=1.7
Subroutine __ANON__: not called CC=1 SCAR=6.9
34 0 ▶ '""' => sub ($s, @) {
Subroutine __ANON__: not called CC=2 SCAR=17.9
35 0 ▶ $s->detail // 'Unknown error.';
Condition0%0/2
$s->detail // "Unknown error."
l!l
00
MC/DC0%0/1
$s->detail // "Unknown error."
$s->detail
Truth table0%0/2
A
A= $s->detail
Aresult
11
00
36 },
37 1 fallback => 1;
38 #
39  
40 =head2 C<detail( )>
41  
42 warn $error->detail;
43  
44 Returns a string. If this is a failed API call, the message returned by the
45 service is here.
46  
47 =cut
48  
49 1 has _rh => undef => weak => 1;
50 1 has ['detail'];
51  
52 =head1 LEGAL
53  
54 This is a simple wrapper around the API used in the official apps. The author
55 provides no investment, legal, or tax advice and is not responsible for any
56 damages incurred while using this software. This software is not affiliated
57 with Robinhood Financial LLC in any way.
58  
59 For Robinhood's terms and disclosures, please see their website at
60 https://robinhood.com/legal/
61  
62 =head1 LICENSE
63  
64 Copyright (C) Sanko Robinson.
65  
66 This library is free software; you can redistribute it and/or modify it under
67 the terms found in the Artistic License 2. Other copyrights, terms, and
68 conditions may apply to data transmitted through this module. Please refer to
69 the L<LEGAL> section.
70  
71 =head1 AUTHOR
72  
73 Sanko Robinson E<lt>sanko@cpan.orgE<gt>
74  
75 =cut
76  
77 1 1;
« lib/Finance/Robinhood/Equity/Account/MarginBalances.pm ↑ Summary lib/Finance/Robinhood/User/InternationalInfo.pm »