1File::KDBX::Error(3)  User Contributed Perl Documentation File::KDBX::Error(3)
2
3
4

NAME

6       File::KDBX::Error - Represents something bad that happened
7

VERSION

9       version 0.906
10

ATTRIBUTES

12   details
13           \%details = $error->details;
14
15       Get the error details.
16
17   errno
18       Get the value of "errno" when the exception was created.
19
20   previous
21       Get the value of $@ (i.e. latest exception) at the time the exception
22       was created.
23
24   trace
25       Get a stack trace indicating where in the code the exception was
26       created.
27
28   type
29       Get the exception type, if any.
30

METHODS

32   new
33           $error = File::KDBX::Error->new($message, %details);
34
35       Construct a new error.
36
37   error
38           $error = error($error);
39           $error = error($message, %details);
40           $error = File::KDBX::Error->error($error);
41           $error = File::KDBX::Error->error($message, %details);
42
43       Wrap a thing to make it an error object. If the thing is already an
44       error, it gets returned. Otherwise what is passed will be forwarded to
45       "new" to create a new error object.
46
47       This can be convenient for error handling when you're not sure what the
48       exception is but you want to treat it as a File::KDBX::Error. Example:
49
50           eval { ... };
51           if (my $error = error(@_)) {
52               if ($error->type eq 'key.missing') {
53                   handle_missing_key($error);
54               }
55               else {
56                   handle_other_error($error);
57               }
58           }
59
60   to_string
61           $message = $error->to_string;
62           $message = "$error";
63
64       Stringify an error.
65
66       This does not contain a stack trace, but you can set the "DEBUG"
67       environment variable to at least 2 to stringify the whole error object.
68
69   throw
70           File::KDBX::Error::throw($message, %details);
71           $error->throw;
72
73       Throw an error.
74
75   warn
76           File::KDBX::Error::warn($message, %details);
77           $error->warn;
78
79       Log a warning.
80
81   alert
82           alert $error;
83
84       Importable alias for "warn".
85

BUGS

87       Please report any bugs or feature requests on the bugtracker website
88       <https://github.com/chazmcgarvey/File-KDBX/issues>
89
90       When submitting a bug or request, please include a test-file or a patch
91       to an existing test-file that illustrates the bug or desired feature.
92

AUTHOR

94       Charles McGarvey <ccm@cpan.org>
95
97       This software is copyright (c) 2022 by Charles McGarvey.
98
99       This is free software; you can redistribute it and/or modify it under
100       the same terms as the Perl 5 programming language system itself.
101
102
103
104perl v5.38.0                      2023-09-27              File::KDBX::Error(3)
Impressum