File: Error.pm

package info (click to toggle)
libmr-tarantool-perl 0.0.24-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 416 kB
  • sloc: perl: 3,662; makefile: 2
file content (89 lines) | stat: -rw-r--r-- 888 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package MR::IProto::Error;

=head1 NAME

MR::IProto::Error - iproto error

=head1 DESCRIPTION

Instance of this class is returned instead of L<MR::IProto::Response>
if error was occurred.

=cut

use Mouse;

=head1 PUBLIC ATTRIBUTES

=over

=item error

Error string.

=cut

has error => (
    is  => 'ro',
    isa => 'Str',
    required => 1,
);

=item errno

Integer value of C<$!>.

=cut

has errno => (
    is  => 'ro',
    isa => 'Int',
);

=item request

Instance of L<MR::IProto::Request>.

=cut

has request => (
    is  => 'ro',
    isa => 'MR::IProto::Request',
    required => 1,
);

=back

=head1 PUBLIC METHODS

=over

=item is_error

Always returns true.

=cut

sub is_error {
    return 1;
}

=item error_message

Error message text.

=cut

sub error_message {
    my ($self) = @_;
    return $self->error;
}

=back

=cut

no Mouse;
__PACKAGE__->meta->make_immutable();

1;