MINI MINI MANI MO
# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
#
# NAME
# asmcmdxmlexceptions - ASM CoMmanD line interface
# (Exception Handling Functionality Module)
#
# DESCRIPTION
# ASMCMD is a Perl utility that provides easy nagivation of files within
# ASM diskgroups. This module provides some basic functionalities
# for handling exceptions. This module is written using OOP concepts
# and is the base class for all asmcmd exceptions.
# This class should be inheritted by other exception classes.
#
# MODIFIED (MM/DD/YY)
# adileepk 03/10/11 - Creation
#
#
#
#############################################################################
#
############################ Functions List #################################
# asmcmdxmlexceptions::throw
# asmcmdxmlexceptions::catch
#
#############################################################################
package asmcmdxmlexceptions;
use strict;
use asmcmdexceptions;
our @ISA = ('asmcmdexceptions', 'Exporter');
our @EXPORT = qw(asmcmdxmlexceptions::throw
asmcmdxmlexceptions::catch
);
########
# NAME
# asmcmdxmlexceptions::throw
#
# DESCRIPTION
# This routine throws an exception of type asmcmdxmlexceptions
#
# PARAMETERS
# None.
#
# RETURNS
# The last staement of this function is die, which raises the exception.
########
sub asmcmdxmlexceptions::throw
{
my $class = "asmcmdxmlexceptions";
my ($package, $filename, $line) = caller;
my $newException = new asmcmdexceptions($class, "XML Exception", $package,
$filename, $line);
die "XML Exception raised";
}
########
# NAME
# asmcmdxmlexceptions::catch
#
# DESCRIPTION
# This routine catches the most recent XML Exception to be raised.
#
# PARAMETERS
# None.
#
# RETURNS
# 0 - If no XML exceptions were caught.
# 1 - If an XMLexception was successfully caught.
########
sub asmcmdxmlexceptions::catch
{
return 0 if asmcmdexceptions::noexceptions();
my $class = "asmcmdxmlexceptions";
my $exceptype = asmcmdexceptions::getType();
return asmcmdexceptions::catch() if($exceptype eq $class);
}
1;
OHA YOOOO