| 1 | package ShardedKV::Error::WriteFail; | ||
| 2 | 3 | $ShardedKV::Error::WriteFail::VERSION = '0.20'; | |
| 3 | 3 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 3 | extends 'ShardedKV::Error'; | |
| 5 | |||
| 6 | #ABSTRACT: Thrown when set() fails on a storage backend | ||
| 7 | |||
| 8 | |||
| 9 | |||
| 10 | 3 | has key => ( | |
| 11 | is => 'ro', | ||
| 12 | isa => 'Str', | ||
| 13 | required => 1, | ||
| 14 | ); | ||
| 15 | |||
| 16 | |||
| 17 | |||
| 18 | 3 | has operation => ( | |
| 19 | is => 'ro', | ||
| 20 | isa => Moose::Util::TypeConstraints::enum([qw/set expire/]), | ||
| 21 | predicate => 'has_operation' | ||
| 22 | ); | ||
| 23 | |||
| 24 | 3 | 1; | |
| 25 | 3 | __PACKAGE__->meta->make_immutable(inline_constructor => 0); | |
| 26 | |||
| 27 | =pod | ||
| 28 | |||
| 29 | =head1 NAME | ||
| 30 | |||
| 31 | ShardedKV::Error::WriteFail - Thrown when set() fails on a storage backend | ||
| 32 | |||
| 33 | =head1 VERSION | ||
| 34 | |||
| 35 | version 0.20 | ||
| 36 | |||
| 37 | =head1 DESCRIPTION | ||
| 38 | |||
| 39 | ShardedKV::Error::WriteFail is an exception thrown when there is a problem | ||
| 40 | writing to the particular storage backend. The exception will contain which key | ||
| 41 | failed, and potentially which operation during the set() failed. | ||
| 42 | |||
| 43 | =head1 PUBLIC ATTRIBUTES | ||
| 44 | |||
| 45 | =head2 key | ||
| 46 | |||
| 47 | (is: ro, isa: Str, required) | ||
| 48 | |||
| 49 | key holds what particular key was used for the set() call. | ||
| 50 | |||
| 51 | =head2 operation | ||
| 52 | |||
| 53 | (is: ro, isa: enum(set, expire)) | ||
| 54 | |||
| 55 | operation may contain what operation the set was doing when the failure | ||
| 56 | occurred. In the case of the Redis storage backend, the expiration operation is | ||
| 57 | separate from the actual set operation. In those two cases, this attribute will | ||
| 58 | be set with the appropriate operation. Other backends may or may not supply | ||
| 59 | this value. | ||
| 60 | |||
| 61 | =head1 PUBLIC METHODS | ||
| 62 | |||
| 63 | =head2 has_operation | ||
| 64 | |||
| 65 | has_operation() is the predicate check for the L</operation> attribute. It | ||
| 66 | checks if operation is defined (ie. the backend set a value). | ||
| 67 | |||
| 68 | =head1 AUTHORS | ||
| 69 | |||
| 70 | =over 4 | ||
| 71 | |||
| 72 | =item * | ||
| 73 | |||
| 74 | Steffen Mueller <smueller@cpan.org> | ||
| 75 | |||
| 76 | =item * | ||
| 77 | |||
| 78 | Nick Perez <nperez@cpan.org> | ||
| 79 | |||
| 80 | =item * | ||
| 81 | |||
| 82 | Damian Gryski <dgryski@cpan.org> | ||
| 83 | |||
| 84 | =back | ||
| 85 | |||
| 86 | =head1 COPYRIGHT AND LICENSE | ||
| 87 | |||
| 88 | This software is copyright (c) 2013 by Steffen Mueller. | ||
| 89 | |||
| 90 | This is free software; you can redistribute it and/or modify it under | ||
| 91 | the same terms as the Perl 5 programming language system itself. | ||
| 92 | |||
| 93 | =cut | ||
| 94 | |||
| 95 | __END__ | ||