Net::LDAPxs::Exception - Object handling the exceptions


Net-LDAPxs documentation Contained in the Net-LDAPxs distribution.

Index


Code Index:

NAME

Top

Net::LDAPxs::Exception - Object handling the exceptions

SYNOPSIS

Top

  use Net::LDAPxs;

  $mesg = $ldap->search( $dn, password => "secret" );
  die $mesg->errstr if $mesg->err;

DESCRIPTION

Top

When exception happens, a Net::LDAPxs::Exception object is returned from the methods of a Net::LDAPxs object. It is used for displaying both error codes and error messages sent from LDAP server.

METHODS

Top

code

This method is for detecting whether there is an exception.

errstr

Method errstr is in charge of displaying the error messages sent from the LDAP server.

AUTHOR

Top

Pan Yu <xiaocong@vip.163.com>

COPYRIGHT AND LICENSE

Top


Net-LDAPxs documentation Contained in the Net-LDAPxs distribution.

package Net::LDAPxs::Exception;

use 5.006;
use strict;
use vars qw($VERSION);

$VERSION = '1.01';


sub err {
	return 1 if shift->{code} != 0;
}

sub errstr { 
	my $self = shift;

	"Error code($self->{code}): $self->{mesg}";
}

sub code {
	shift->{code};
}

1;

__END__