1 | # ------------------------------------------------------------------------------ |
---|
2 | # Copyright (C) 2006-2021 British Crown (Met Office) & Contributors. |
---|
3 | # |
---|
4 | # This file is part of FCM, tools for managing and building source code. |
---|
5 | # |
---|
6 | # FCM is free software: you can redistribute it and/or modify |
---|
7 | # it under the terms of the GNU General Public License as published by |
---|
8 | # the Free Software Foundation, either version 3 of the License, or |
---|
9 | # (at your option) any later version. |
---|
10 | # |
---|
11 | # FCM is distributed in the hope that it will be useful, |
---|
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | # GNU General Public License for more details. |
---|
15 | # |
---|
16 | # You should have received a copy of the GNU General Public License |
---|
17 | # along with FCM. If not, see <http://www.gnu.org/licenses/>. |
---|
18 | # ------------------------------------------------------------------------------ |
---|
19 | use strict; |
---|
20 | use warnings; |
---|
21 | |
---|
22 | # ------------------------------------------------------------------------------ |
---|
23 | package FCM::CLI::Exception; |
---|
24 | use base qw{FCM::Exception}; |
---|
25 | |
---|
26 | use constant { |
---|
27 | APP => 'APP', |
---|
28 | OPT => 'OPT', |
---|
29 | }; |
---|
30 | |
---|
31 | # ------------------------------------------------------------------------------ |
---|
32 | 1; |
---|
33 | __END__ |
---|
34 | |
---|
35 | =head1 NAME |
---|
36 | |
---|
37 | FCM::CLI::Exception |
---|
38 | |
---|
39 | =head1 SYNOPSIS |
---|
40 | |
---|
41 | use FCM::CLI::Exception; |
---|
42 | FCM::CLI::Exception->throw(FCM::CLI::Exception->APP, \@argv, $e); |
---|
43 | FCM::CLI::Exception->throw(FCM::CLI::Exception->OPT, \@argv, $e); |
---|
44 | |
---|
45 | =head1 DESCRIPTION |
---|
46 | |
---|
47 | An exception associated with the FCM CLI. It is a sub-class of |
---|
48 | L<FCM::Exception|FCM::Exception>. The $e->get_ctx() method returns an ARRAY |
---|
49 | reference containing the argument list. The $e->get_code() method may return |
---|
50 | either $e->APP (if an unknown application is specified) or $e->OPT (if an |
---|
51 | unknown option is specified, i.e. the option parser returns some errors). |
---|
52 | |
---|
53 | =head1 COPYRIGHT |
---|
54 | |
---|
55 | Copyright (C) 2006-2021 British Crown (Met Office) & Contributors. |
---|
56 | |
---|
57 | =cut |
---|