File Coverage

blib/lib/Stancer/Exceptions/Throwable.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 19 19 100.0


line stmt bran cond sub pod time code
1             package Stancer::Exceptions::Throwable;
2              
3 112     112   426142 use 5.020;
  112         491  
4 112     112   761 use strict;
  112         304  
  112         3647  
5 112     112   617 use warnings;
  112         235  
  112         11401  
6              
7             # ABSTRACT: Base exception
8             our $VERSION = '1.0.3'; # VERSION
9              
10 112     112   2155 use Moo;
  112         21792  
  112         905  
11              
12             with 'Throwable';
13              
14 112     112   59902 use namespace::clean;
  112         36715  
  112         1358  
15              
16              
17             has log_level => (
18             is => 'ro',
19             default => 'notice',
20             );
21              
22              
23             has message => (
24             is => 'ro',
25             default => 'Unexpected error.',
26             );
27              
28             1;
29              
30             __END__
31              
32             =pod
33              
34             =encoding UTF-8
35              
36             =head1 NAME
37              
38             Stancer::Exceptions::Throwable - Base exception
39              
40             =head1 VERSION
41              
42             version 1.0.3
43              
44             =head1 ATTRIBUTES
45              
46             =head2 C<log_level>
47              
48             Read-only string.
49              
50             Indicate log level for this kind of exception.
51              
52             =head2 C<message>
53              
54             Read-only string.
55              
56             Error message.
57              
58             =head1 USAGE
59              
60             =head2 Logging
61              
62              
63              
64             We use the L<Log::Any> framework for logging events.
65             You may tell where it should log using any available L<Log::Any::Adapter> module.
66              
67             For example, to log everything to a file you just have to add a line to your script, like this:
68             #! /usr/bin/env perl
69             use Log::Any::Adapter (File => '/var/log/payment.log');
70             use Stancer::Exceptions::Throwable;
71              
72             You must import C<Log::Any::Adapter> before our libraries, to initialize the logger instance before use.
73              
74             You can choose your log level on import directly:
75             use Log::Any::Adapter (File => '/var/log/payment.log', log_level => 'info');
76              
77             Read the L<Log::Any> documentation to know what other options you have.
78              
79             =cut
80              
81             =head1 SECURITY
82              
83             =over
84              
85             =item *
86              
87             Never, never, NEVER register a card or a bank account number in your database.
88              
89             =item *
90              
91             Always uses HTTPS in card/SEPA in communication.
92              
93             =item *
94              
95             Our API will never give you a complete card/SEPA number, only the last four digits.
96             If you need to keep track, use these last four digit.
97              
98             =back
99              
100             =cut
101              
102             =head1 BUGS
103              
104             Please report any bugs or feature requests on the bugtracker website
105             L<https://gitlab.com/wearestancer/library/lib-perl/-/issues> or by email to
106             L<bug-stancer@rt.cpan.org|mailto:bug-stancer@rt.cpan.org>.
107              
108             When submitting a bug or request, please include a test-file or a
109             patch to an existing test-file that illustrates the bug or desired
110             feature.
111              
112             =head1 AUTHOR
113              
114             Joel Da Silva <jdasilva@cpan.org>
115              
116             =head1 COPYRIGHT AND LICENSE
117              
118             This software is Copyright (c) 2018-2024 by Stancer / Iliad78.
119              
120             This is free software, licensed under:
121              
122             The Artistic License 2.0 (GPL Compatible)
123              
124             =cut