man WebKDC::WebKDCException () - exceptions for WebKDC

NAME

WebKDC::WebKDCException - exceptions for WebKDC

SYNOPSIS

  use WebKDC;
  use WebKDC::WebKDCException;

  eval {  
    ...
    WebKDC::request_token_request($req, $resp);
    ...
  };
  if (WebKDC::WebKDCException::match($@)) {
    my $e = $@;
    # you can call the following methods on a WebKDCException object:
    # $e->status()
    # $e->message()
    # $e->error_code()
    # $e->verbose_message()
  }

DESCRIPTION

The various WebKDC functions can all throw WebKDCException if something wrong happens.

EXPORT

The following constants are exported:

  WK_SUCCESS
  WK_ERR_USER_AND_PASS_REQUIRED
  WK_ERR_LOGIN_FAILED
  WK_ERR_UNRECOVERABLE_ERROR
  WK_ERR_REQUEST_TOKEN_STATLE
  WK_ERR_WEBAUTH_SERVER_ERROR
WK_SUCCESS
 This status code never comes back as part of an exception, though
 it might be returned by a function that uses these status codes
 as return values.
WK_ERR_USER_AND_PASS_REQUIRED
 This status code indicates that a function was called
 that required a username and password. The user should
 be prompted for their username and the function should be
 called again.
WK_ERR_LOGIN_FAILED
 This status code indicates that a function was called
 that attempted to validate the username and password and
 could not, due to an invalid user or password. The
 user should be re-prompted for their username/password
 and the function should be called again.
WK_ERR_UNRECOVERABLE_ERROR
 This status code indicates that a function was called
 and an error occured that can not be recovered from. If
 you are in the process of attempting to log a user in,
 you have no choice but to display an error message to
 the user and not prompt again.
WK_ERR_REQUEST_TOKEN_STALE
 This status code indicates the user took too long to login, and the
 the request token is too old to be used.
WK_ERR_WEBAUTH_SERVER_ERROR
 This status code indicates something happened that most likely indicates
 the webauth server that made the request is mis-configured and/or
 unauthorized to make the request. It is similar to WK_ERR_UNRECOVERABLE_ERROR
 except that the error message to the user should indicate that the
 problem is most likely with the server that redirected them.

METHODS and FUNCTIONS

  This class function (not a method) returns true if the given
  $exception is a WebKDC::WebKDCException. If $status is specified, then
  $exception->status() will also be compared to $status.
new(status, message, wrapped_exception)
  This method is used to created new WebKDC::WebKDCException objects.
status()
  This method returns the WebKDC::WebKDCException status code for the exception,
  which will be one of the WK_ERR_* codes.
message()
  This method returns the error message that was
  used in the constructor.
error_code()
  This method returns the WebKDC errorCode (if there was one).
verbose_message()
  This method returns a verbose error message, which consists
  of the status code, message, and any error code.
  The verbose_message method is also called if the exception is
  used as a string.

AUTHOR

Roland Schemers (schemers@stanford.edu)

SEE ALSO

WebKDC.