| 1 | package HTML::Widget::Error; | ||
| 2 | |||
| 3 | use warnings; | ||
| 4 | use strict; | ||
| 5 | use base 'Class::Accessor::Fast'; | ||
| 6 | |||
| 7 | __PACKAGE__->mk_accessors(qw/name message type no_render/); | ||
| 8 | |||
| 9 | use overload '""' => sub { return shift->message }, fallback => 1; | ||
| 10 | |||
| 11 | =head1 NAME | ||
| 12 | |||
| 13 | HTML::Widget::Error - Error | ||
| 14 | |||
| 15 | =head1 SYNOPSIS | ||
| 16 | |||
| 17 | my @errors = $form->errors('foo'); | ||
| 18 | for my $error (@errors) { | ||
| 19 | print $error->type; | ||
| 20 | print $error->message; | ||
| 21 | } | ||
| 22 | |||
| 23 | =head1 DESCRIPTION | ||
| 24 | |||
| 25 | Error. | ||
| 26 | |||
| 27 | =head1 METHODS | ||
| 28 | |||
| 29 | =head2 name | ||
| 30 | |||
| 31 | Arguments: $name | ||
| 32 | |||
| 33 | Return Value: $name | ||
| 34 | |||
| 35 | =head2 message | ||
| 36 | |||
| 37 | Arguments: $message | ||
| 38 | |||
| 39 | Return Value: $message | ||
| 40 | |||
| 41 | =head2 no_render | ||
| 42 | |||
| 43 | Arguments: $bool | ||
| 44 | |||
| 45 | If true, this error will not be displayed by C<< $result->as_xml >>. | ||
| 46 | |||
| 47 | This is used internally used by L<HTML::Widget::Constraint/render_errors>. | ||
| 48 | |||
| 49 | =head2 type | ||
| 50 | |||
| 51 | Arguments: $type | ||
| 52 | |||
| 53 | Return Value: $type | ||
| 54 | |||
| 55 | =head1 AUTHOR | ||
| 56 | |||
| 57 | Sebastian Riedel, C<sri@oook.de> | ||
| 58 | |||
| 59 | =head1 LICENSE | ||
| 60 | |||
| 61 | This library is free software, you can redistribute it and/or modify it under | ||
| 62 | the same terms as Perl itself. | ||
| 63 | |||
| 64 | =cut | ||
| 65 | |||
| 66 | 1; |