CLI::Framework::Exceptions - Exceptions used by CLIF


CLI-Framework documentation Contained in the CLI-Framework distribution.

Index


Code Index:

NAME

Top

CLI::Framework::Exceptions - Exceptions used by CLIF

EXCEPTION TYPES

Top

This package defines the following exception types. These exception objects are created using Exception::Class and are subtypes of Exception::Class::Base.

CLI::Framework::Exception

description

General CLIF error

alias

throw_clif_exception

CLI::Framework::Exception::AppHookException

description

Application hook method failed preconditions

alias

throw_app_hook_exception

CLI::Framework::Exception::AppOptsParsingException

description

Failed parsing of application options

alias

throw_app_opts_parse_exception

CLI::Framework::Exception::AppOptsValidationException

description

Failed validation of application options

alias

throw_app_opts_validation_exception

CLI::Framework::Exception::AppInitException

description

Failed application initialization

alias

throw_app_init_exception

CLI::Framework::Exception::InvalidCmdException

description

Invalid command

alias

throw_invalid_cmd_exception

CLI::Framework::Exception::CmdRegistrationException

description

Failed command registration

alias

throw_cmd_registration_exception

CLI::Framework::Exception::TypeException

description

Object is not of the proper type

alias

throw_type_exception

CLI::Framework::Exception::CmdOptsParsingException

description

Failed parsing of command options

alias

throw_cmd_opts_parse_exception

CLI::Framework::Exception::CmdValidationException

description

Failed validation of command options/arguments

alias

throw_cmd_validation_exception

CLI::Framework::Exception::CmdRunException

description

Failure to run command

alias

throw_cmd_run_exception

EXPORTS

Top

All aliases are available for use by client code (but none are exported by default). The ':all' tag causes all of the aliases to be exported.

SEE ALSO

Top

Exception::Class

CLI::Framework::Application


CLI-Framework documentation Contained in the CLI-Framework distribution.

package CLI::Framework::Exceptions;

use strict;
use warnings;

our $VERSION = 0.02;

# Make it possible to use aliases directly in client code...
use Exporter qw( import );
our @EXPORT_OK = qw(
    throw_clif_exception
    throw_app_hook_exception
    throw_app_opts_parse_exception
    throw_app_opts_validation_exception
    throw_app_init_exception
    throw_invalid_cmd_exception
    throw_cmd_registration_exception
    throw_type_exception
    throw_cmd_opts_parse_exception
    throw_cmd_validation_exception
    throw_cmd_run_exception
);

our %EXPORT_TAGS = ( all => \@EXPORT_OK );

# Create exception class hierarchy...
use Exception::Class (
    'CLI::Framework::Exception' => {
        description =>  'General CLIF error',
        alias       =>  'throw_clif_exception',
    },
    'CLI::Framework::Exception::AppHookException' => {
        isa         => 'CLI::Framework::Exception',
        description => 'Application hook method failed preconditions',
        alias       => 'throw_app_hook_exception',
    },
    'CLI::Framework::Exception::AppOptsParsingException' => {
        isa         => 'CLI::Framework::Exception',
        description => 'Failed parsing of application options',
        alias       => 'throw_app_opts_parse_exception'
    },
    'CLI::Framework::Exception::AppOptsValidationException' => {
        isa         => 'CLI::Framework::Exception',
        description => 'Failed validation of application options',
        alias       => 'throw_app_opts_validation_exception'
    },
    'CLI::Framework::Exception::AppInitException' => {
        isa         => 'CLI::Framework::Exception',
        description => 'Failed application initialization',
        alias       => 'throw_app_init_exception'
    },
    'CLI::Framework::Exception::InvalidCmdException' => {
        isa         => 'CLI::Framework::Exception',
        description => 'Invalid command',
        alias       => 'throw_invalid_cmd_exception'
    },
    'CLI::Framework::Exception::CmdRegistrationException' => {
        isa         => 'CLI::Framework::Exception',
        description => 'Failed command registration',
        alias       => 'throw_cmd_registration_exception',
    },
    'CLI::Framework::Exception::TypeException' => {
        isa         => 'CLI::Framework::Exception',
        description => 'Object is not of the proper type',
        alias       => 'throw_type_exception',
    },
    'CLI::Framework::Exception::CmdOptsParsingException' => {
        isa         => 'CLI::Framework::Exception',
        description => 'Failed parsing of command options',
        alias       => 'throw_cmd_opts_parse_exception'
    },
    'CLI::Framework::Exception::CmdValidationException' => {
        isa         => 'CLI::Framework::Exception',
        description => 'Failed validation of command options/arguments',
        alias       => 'throw_cmd_validation_exception'
    },
    'CLI::Framework::Exception::CmdRunException' => {
        isa         => 'CLI::Framework::Exception',
        description => 'Failure to run command',
        alias       => 'throw_cmd_run_exception'
    },
);

#-------
1;

__END__