| 1 | package WebService::Mattermost::V4::API::Object::Error; | ||
| 2 | |||
| 3 | # ABSTRACT: An error item. | ||
| 4 | |||
| 5 | 12 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 12 | ▶ | use Types::Standard qw(Str Maybe); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 12 | extends 'WebService::Mattermost::V4::API::Object'; | |
| 9 | 12 | 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 | 12 | has detailed_error => (is => 'ro', isa => Maybe[Str], lazy => 1, builder => 1); | |
| 19 | |||
| 20 | ################################################################################ | ||
| 21 | |||
| 22 | sub _build_detailed_error { | ||
| 23 | 0 | ▶ | my $self = shift; |
|
Subroutine
_build_detailed_error: not called CC=1 SCAR=6.9
| |||
| 24 | |||
| 25 | 0 | return $self->raw_data->{detailed_error}; | |
| 26 | } | ||
| 27 | |||
| 28 | sub _build_id { | ||
| 29 | 0 | ▶ | my $self = shift; |
|
Subroutine
_build_id: not called CC=1 SCAR=6.9
| |||
| 30 | |||
| 31 | 0 | return $self->raw_data->{id}; | |
| 32 | } | ||
| 33 | |||
| 34 | sub _build_request_id { | ||
| 35 | 0 | ▶ | my $self = shift; |
|
Subroutine
_build_request_id: not called CC=1 SCAR=6.9
| |||
| 36 | |||
| 37 | 0 | return $self->raw_data->{request_id}; | |
| 38 | } | ||
| 39 | |||
| 40 | sub _build_status_code { | ||
| 41 | 0 | ▶ | my $self = shift; |
|
Subroutine
_build_status_code: not called CC=1 SCAR=6.9
| |||
| 42 | |||
| 43 | 0 | return $self->raw_data->{status_code}; | |
| 44 | } | ||
| 45 | |||
| 46 | ################################################################################ | ||
| 47 | |||
| 48 | 12 | 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.28 | ||
| 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 | ||