| 1 | package Data::Riak::Request::WithHTTPExceptionHandling; | ||
| 2 | { | ||
| 3 | $Data::Riak::Request::WithHTTPExceptionHandling::VERSION = '2.0'; | ||
| 4 | } | ||
| 5 | |||
| 6 | use Moose::Role; | ||
| 7 | use namespace::autoclean; | ||
| 8 | |||
| 9 | with 'Data::Riak::Request'; | ||
| 10 | |||
| 11 | has http_exception_classes => ( | ||
| 12 | traits => ['Hash'], | ||
| 13 | is => 'ro', | ||
| 14 | isa => 'HashRef[ClassName|Undef]', | ||
| 15 | builder => '_build_http_exception_classes', | ||
| 16 | handles => { | ||
| 17 | has_exception_class_for_http_status => 'exists', | ||
| 18 | exception_class_for_http_status => 'get', | ||
| 19 | }, | ||
| 20 | ); | ||
| 21 | |||
| 22 | requires '_build_http_exception_classes'; | ||
| 23 | |||
| 24 | 1; | ||
| 25 | |||
| 26 | __END__ |