#!/usr/bin/perl -Tw
################################################################################
package WWW::Yahoo::Credentials::Exceptions;
# $Id: Exceptions.pm,v 1.1 2003/09/24 18:20:10 ken Exp $

=pod

=head1 NAME

WWW::Yahoo::Credentials::Exceptions - exceptions related to credentials file

=head1 SYNOPSIS

  require WWW::Yahoo::Credentials;
  eval { something };
  if ( ref $@ ) {
      if ( $@->isa( 'WWW::Yahoo::Credentials::Exception::Usage' ) ) {
	  die "Usage error: $@\n";
      }
      elsif ( $@->isa( 'WWW::Yahoo::Credentials::Exception::Syntax' ) ) {
	  die "Syntax error: $@\n";
      }
      elsif ( $@->isa( 'WWW::Yahoo::Credentials::Exception::File' ) ) {
	  die "File error: $@\n";
      }
      elsif ( $@->isa( 'WWW::Yahoo::Credentials::Exception::Directory' ) ) {
	  die "Directory error: $@\n";
      }
  }
  die $@ if $@;

=head1 DESCRIPTION

This module defines several classes of exceptions as described below.

=cut

################################################################################
use 5.006;
use strict;
use warnings;
our $VERSION = '0.80';
use Exception::Class
  ( 'WWW::Yahoo::Credentials::Exception' =>
    { description => 'credentials exception' } );

################################################################################

=pod

=head2 WWW::Yahoo::Credentials::Exception::Usage

Incorrect or invalid usage of method parameters.  Note that a full
stack trace will be printed when this exception is stringified to help
you find out where the mistake occurred.  To disable the stack trace,
include this line somewhere after "require WWW::Yahoo::Credentials":

  WWW::Yahoo::Credentials::Exception::Usage->Trace(0);

=cut

#-------------------------------------------------------------------------------
use Exception::Class
  ( 'WWW::Yahoo::Credentials::Exception::Usage' =>
    { isa => 'WWW::Yahoo::Credentials::Exception',
      description => 'usage error' } );

WWW::Yahoo::Credentials::Exception::Usage->Trace(1);

################################################################################

=pod

=head2 WWW::Yahoo::Credentials::Exception::File

System error occurred when trying to access credentials file.

=cut

#-------------------------------------------------------------------------------
use Exception::Class
  ( 'WWW::Yahoo::Credentials::Exception::File' =>
    { isa => 'WWW::Yahoo::Credentials::Exception',
      description => 'file error' } );

################################################################################

=pod

=head2 WWW::Yahoo::Credentials::Exception::Directory

System error occurred when trying to access credentials directory.

=cut

#-------------------------------------------------------------------------------
use Exception::Class
  ( 'WWW::Yahoo::Credentials::Exception::Directory' =>
    { isa => 'WWW::Yahoo::Credentials::Exception',
      description => 'directory error' } );

################################################################################

=pod

=head2 WWW::Yahoo::Credentials::Exception::Syntax

Invalid syntax in the credentials file.

=cut

#-------------------------------------------------------------------------------
use Exception::Class
  ( 'WWW::Yahoo::Credentials::Exception::Syntax' =>
    { isa => 'WWW::Yahoo::Credentials::Exception',
      description => 'syntax error' } );

################################################################################

=pod

=head1 SEE ALSO

L<WWW::Yahoo::Credentials|WWW::Yahoo::Credentials>,
L<WWW::Yahoo::Credentials::File|WWW::Yahoo::Credentials::File>,
L<Exception::Class|Exception::Class>

=head1 AUTHOR

Ken Neighbors, Ph.D.
ken@nsds.com

=head1 COPYRIGHT AND LICENSE

Copyright 2003 by Ken Neighbors

This module is free software; you can redistribute it and/or modify it
under the same terms as Perl itself, either Perl version 5.000 or (at
your option) any later version of Perl.  That is, you can redistribute
this module and/or modify it under the terms of either:

  a) the GNU General Public License as published by the Free Software
     Foundation; either version 1, or (at your option) any later version,
     or

  b) the "Artistic License" which comes with Perl, or

  c) the license terms of Perl versions later than 5.000

=cut

1;
