APIdia Launch Partner
Top Description Fields Constructors Methods
javax.security.sasl

public Class SaslException

extends IOException
Class Inheritance
Known Direct Subclasses
javax.security.sasl.AuthenticationException
Imports
java.io.IOException, .Serial

This class represents an error that has occurred when using SASL.
Authors
Rosanna Lee, Rob Weltman
Since
1.5

Field Summary

Modifier and TypeField and Description
private Throwable
_exception

The possibly null root cause exception.

private static final long
serialVersionUID

Hides java.io.IOException.serialVersionUID.

Use serialVersionUID from JSR 28 RI for interoperability

Constructor Summary

AccessConstructor and Description
public
SaslException()

Constructs a new instance of SaslException.

public
SaslException(String
A possibly null string containing details of the exception.
detail
)

Constructs a new instance of SaslException with a detailed message.

public
SaslException(String
A possibly null string containing details of the exception.
detail
,
Throwable
A possibly null root exception that caused this exception.
ex
)

Constructs a new instance of SaslException with a detailed message and a root exception.

Method Summary

Modifier and TypeMethod and Description
public Throwable
getCause()

Overrides java.lang.Throwable.getCause.

Returns the cause of this throwable or null if the cause is nonexistent or unknown.

public Throwable
initCause(Throwable cause)

Overrides java.lang.Throwable.initCause.

Initializes the cause of this throwable to the specified value.

public String

Returns:

The non-null string representation of this exception.
toString
()

Overrides java.lang.Throwable.toString.

Returns the string representation of this exception.

Field Detail

_exceptionback to summary
private Throwable _exception

The possibly null root cause exception.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.io.IOException.serialVersionUID.

Use serialVersionUID from JSR 28 RI for interoperability

Annotations
@Serial

Constructor Detail

SaslExceptionback to summary
public SaslException()

Constructs a new instance of SaslException. The root exception and the detailed message are null.

SaslExceptionback to summary
public SaslException(String detail)

Constructs a new instance of SaslException with a detailed message. The root exception is null.

Parameters
detail:String

A possibly null string containing details of the exception.

See Also
java.lang.Throwable#getMessage
SaslExceptionback to summary
public SaslException(String detail, Throwable ex)

Constructs a new instance of SaslException with a detailed message and a root exception. For example, a SaslException might result from a problem with the callback handler, which might throw a NoSuchCallbackException if it does not support the requested callback, or throw an IOException if it had problems obtaining data for the callback. The SaslException's root exception would be then be the exception thrown by the callback handler.

Parameters
detail:String

A possibly null string containing details of the exception.

ex:Throwable

A possibly null root exception that caused this exception.

See Also
java.lang.Throwable#getMessage, getCause

Method Detail

getCauseback to summary
public Throwable getCause()

Overrides java.lang.Throwable.getCause.

Doc from java.lang.Throwable.getCause.

Returns the cause of this throwable or null if the cause is nonexistent or unknown. (The cause is the throwable that caused this throwable to get thrown.)

This implementation returns the cause that was supplied via one of the constructors requiring a Throwable, or that was set after creation with the initCause(Throwable) method. While it is typically unnecessary to override this method, a subclass can override it to return a cause set by some other means. This is appropriate for a "legacy chained throwable" that predates the addition of chained exceptions to Throwable. Note that it is not necessary to override any of the PrintStackTrace methods, all of which invoke the getCause method to determine the cause of a throwable.

initCauseback to summary
public Throwable initCause(Throwable cause)

Overrides java.lang.Throwable.initCause.

Doc from java.lang.Throwable.initCause.

Initializes the cause of this throwable to the specified value. (The cause is the throwable that caused this throwable to get thrown.)

This method can be called at most once. It is generally called from within the constructor, or immediately after creating the throwable. If this throwable was created with Throwable(Throwable) or Throwable(String, Throwable), this method cannot be called even once.

An example of using this method on a legacy throwable type without other support for setting the cause is:

try {
    lowLevelOp();
} catch (LowLevelException le) {
    throw (HighLevelException)
          new HighLevelException().initCause(le); // Legacy constructor
}
toStringback to summary
public String toString()

Overrides java.lang.Throwable.toString.

Returns the string representation of this exception. The string representation contains this exception's class name, its detailed message, and if it has a root exception, the string representation of the root exception. This string representation is meant for debugging and not meant to be interpreted programmatically.

Returns:String

The non-null string representation of this exception.

See Also
java.lang.Throwable#getMessage