File Coverage

blib/lib/WebService/Mattermost/V4/API/Object/Error.pm
Criterion Covered Total %
statement 6 14 42.8
branch n/a
condition n/a
subroutine 2 6 33.3
pod n/a
total 8 20 40.0


line stmt bran cond sub pod time code
1             package WebService::Mattermost::V4::API::Object::Error;
2              
3             # ABSTRACT: An error item.
4              
5 7     7   45 use Moo;
  7         16  
  7         37  
6 7     7   2270 use Types::Standard qw(Str Maybe);
  7         16  
  7         43  
7              
8             extends 'WebService::Mattermost::V4::API::Object';
9             with    qw(
10             WebService::Mattermost::V4::API::Object::Role::ID
11             WebService::Mattermost::V4::API::Object::Role::Message
12             WebService::Mattermost::V4::API::Object::Role::RequestID
13             WebService::Mattermost::V4::API::Object::Role::StatusCode
14             );
15              
16             ################################################################################
17              
18             has detailed_error => (is => 'ro', isa => Maybe[Str], lazy => 1, builder => 1);
19              
20             ################################################################################
21              
22             sub _build_detailed_error {
23 0     0         my $self = shift;
24              
25 0               return $self->raw_data->{detailed_error};
26             }
27              
28             sub _build_id {
29 0     0         my $self = shift;
30              
31 0               return $self->raw_data->{id};
32             }
33              
34             sub _build_request_id {
35 0     0         my $self = shift;
36              
37 0               return $self->raw_data->{request_id};
38             }
39              
40             sub _build_status_code {
41 0     0         my $self = shift;
42              
43 0               return $self->raw_data->{status_code};
44             }
45              
46             ################################################################################
47              
48             1;
49              
50             __END__
51            
52             =pod
53            
54             =encoding UTF-8
55            
56             =head1 NAME
57            
58             WebService::Mattermost::V4::API::Object::Error - An error item.
59            
60             =head1 VERSION
61            
62             version 0.26
63            
64             =head1 DESCRIPTION
65            
66             Details an error response from the API.
67            
68             =head2 ATTRIBUTES
69            
70             =over 4
71            
72             =item C<detailed_error>
73            
74             =back
75            
76             =head1 SEE ALSO
77            
78             =over 4
79            
80             =item L<WebService::Mattermost::V4::API::Object::Role::ID>
81            
82             =item L<WebService::Mattermost::V4::API::Object::Role::Message>
83            
84             =item L<WebService::Mattermost::V4::API::Object::Role::RequestID>
85            
86             =item L<WebService::Mattermost::V4::API::Object::Role::StatusCode>
87            
88             =item L<Error documentation|https://api.mattermost.com/#tag/errors>
89            
90             Official documentation for API errors.
91            
92             =back
93            
94             =head1 AUTHOR
95            
96             Mike Jones <mike@netsplit.org.uk>
97            
98             =head1 COPYRIGHT AND LICENSE
99            
100             This software is Copyright (c) 2020 by Mike Jones.
101            
102             This is free software, licensed under:
103            
104             The MIT (X11) License
105            
106             =cut
107