File: Exception.pm

package info (click to toggle)
libmojo-ioloop-readwriteprocess-perl 1.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 540 kB
  • sloc: perl: 4,655; sh: 101; makefile: 2
file content (53 lines) | stat: -rw-r--r-- 1,109 bytes parent folder | download | duplicates (6)
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
package Mojo::IOLoop::ReadWriteProcess::Exception;
use Mojo::Base -base;

sub new {
  my $class = shift;
  my $value = @_ == 1 ? $_[0] : "";
  return bless \$value, ref $class || $class;
}

sub to_string { "${$_[0]}" }

1;

=encoding utf-8

=head1 NAME

Mojo::IOLoop::ReadWriteProcess::Exception - Exception object for Mojo::IOLoop::ReadWriteProcess.

=head1 SYNOPSIS

    use Mojo::IOLoop::ReadWriteProcess::Exception;

    my $e = Mojo::IOLoop::ReadWriteProcess::Exception->new("Errored!");

    print "Error $e";

    my $string_error = $e->to_string;

=head1 METHODS

L<Mojo::IOLoop::ReadWriteProcess::Exception> inherits all methods from L<Mojo::Base> and implements
the following new ones.

=head2 to_string

    my $e = Mojo::IOLoop::ReadWriteProcess::Exception->new("Errored!");
    my $string_error = $e->to_string;

Returns stringified version of the error message.

=head1 LICENSE

Copyright (C) Ettore Di Giacinto.

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=head1 AUTHOR

Ettore Di Giacinto E<lt>edigiacinto@suse.comE<gt>

=cut