GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Luka::Exceptions(3) User Contributed Perl Documentation Luka::Exceptions(3)

Luka::Exceptions - exception classes

    use Luka::Exceptions;
    use Error qw(:try);
    push @Exception::Class::Base::ISA, 'Error'
        unless Exception::Class::Base->isa('Error');

    try {
        # some external library that dies unexpectedly
        do_something();
    }
    catch Error with {
        # this will catch errors of any type
        $e = shift;
        throw Luka::Exception::Program( error => $e, show_trace => 1 );
    };

This class provides custom exceptions for Luka.

There are three exceptions that can be thrown:
Luka::Exception::External
network and OS errors (connectivity, file system);
Luka::Exception::User
user interaction related errors
Luka::Exception::Program
internal program errors

All classes have the same fields: error, context, args, path, severity, conf, show_trace.

Error string thrown by library, in perl $! or $@.

Explanation of exception that ought to out error in context for the person dealing with it who doesn't necessarily know much about the script. For example, if an FTP connection fails we should report:

    FTP error: geting SpecialData feed from Someone failed.

and not anything similar to:

    FTP connection failed.

Why? Because to someone dealing with the problem, but not familiar with the application, FTP connection failed says nothing new - usualy, that info is already present in the library error, which should always be in the error field of the exception thrown. So, instead of replicating information provided by the machine, give information known only to you, developer:

object/component dealt with
desired outcome and its importance of its functionality
remote side involved

Arguments that might be needed for resolving the reasons for failure: either those provided to the subroutine from which exception is thrown or those supplied to the external library whose error we're dealing with.

If assigned value 1, this option will include stack trace.

Severity level of the error thrown. See TODO section in Luka.

Id of the error thrown. Can be used as a namespace for tracking errors and linking to appropriate documentation.

Configuration used for Luka system. Used for testing only.

Exception::Class, Luka

Toni Prug <toni@irational.org>

Copyright (c) 2006. Toni Prug. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

See <http://www.gnu.org/licenses/gpl.html>

2006-02-27 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.