| 1 | package Daje::Workflow::Errors::Error; | ||
| 2 | use Mojo::Base -base, -signatures; | ||
| 3 | |||
| 4 | # Daje::Workflow::Errors::Error - Storage container for workflow errors | ||
| 5 | # | ||
| 6 | # METHODS | ||
| 7 | # ======= | ||
| 8 | # | ||
| 9 | # $error->has_error(); | ||
| 10 | # | ||
| 11 | # $error->add_error("Error"); | ||
| 12 | # | ||
| 13 | # | ||
| 14 | |||
| 15 | has 'error' => " "; | ||
| 16 | has 'has_error' => 0; | ||
| 17 | |||
| 18 | sub add_error($self, $error) { | ||
| 19 | return unless length($error); | ||
| 20 | |||
| 21 | my $err = $self->error(); | ||
| 22 | $err = $error . '\n' . $err; | ||
| 23 | $self->error($error); | ||
| 24 | $self->has_error(1); | ||
| 25 | } | ||
| 26 | |||
| 27 | 1; | ||
| 28 | |||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | |||
| 33 | |||
| 34 | |||
| 35 | |||
| 36 | |||
| 37 | |||
| 38 | |||
| 39 | |||
| 40 | #################### pod generated by Pod::Autopod - keep this line to make pod updates possible #################### | ||
| 41 | |||
| 42 | =head1 NAME | ||
| 43 | |||
| 44 | Daje::Workflow::Errors::Error | ||
| 45 | |||
| 46 | |||
| 47 | =head1 DESCRIPTION | ||
| 48 | |||
| 49 | Daje::Workflow::Errors::Error - Storage container for workflow errors | ||
| 50 | |||
| 51 | |||
| 52 | |||
| 53 | =head1 REQUIRES | ||
| 54 | |||
| 55 | L<Mojo::Base> | ||
| 56 | |||
| 57 | |||
| 58 | =head1 METHODS | ||
| 59 | |||
| 60 | |||
| 61 | $error->has_error(); | ||
| 62 | |||
| 63 | $error->add_error("Error"); | ||
| 64 | |||
| 65 | |||
| 66 | |||
| 67 | |||
| 68 | =cut | ||
| 69 |