- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.io.IOException
-
- javax.security.sasl.SaslException
-
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- AuthenticationException
public class SaslException extends IOException
This class represents an error that has occurred when using SASL.- Since:
- 1.5
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description SaslException()
Constructs a new instance of SaslException.SaslException(String detail)
Constructs a new instance of SaslException with a detailed message.SaslException(String detail, Throwable ex)
Constructs a new instance of SaslException with a detailed message and a root exception.
-
Method Summary
Methods Modifier and Type Method and Description Throwable
getCause()
Returns the cause of this throwable ornull
if the cause is nonexistent or unknown.Throwable
initCause(Throwable cause)
Initializes the cause of this throwable to the specified value.String
toString()
Returns the string representation of this exception.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
-
-
-
Constructor Detail
-
SaslException
public SaslException()
Constructs a new instance of SaslException. The root exception and the detailed message are null.
-
SaslException
public SaslException(String detail)
Constructs a new instance of SaslException with a detailed message. The root exception is null.- Parameters:
detail
- A possibly null string containing details of the exception.- See Also:
Throwable.getMessage()
-
SaslException
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
- A possibly null string containing details of the exception.ex
- A possibly null root exception that caused this exception.- See Also:
Throwable.getMessage()
,getCause()
-
-
Method Detail
-
getCause
public Throwable getCause()
Description copied from class:Throwable
Returns the cause of this throwable ornull
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 theThrowable.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 toThrowable
. Note that it is not necessary to override any of thePrintStackTrace
methods, all of which invoke thegetCause
method to determine the cause of a throwable.
-
initCause
public Throwable initCause(Throwable cause)
Description copied from class:Throwable
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(Throwable)
orThrowable.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 }
- Overrides:
initCause
in classThrowable
- Parameters:
cause
- the cause (which is saved for later retrieval by theThrowable.getCause()
method). (Anull
value is permitted, and indicates that the cause is nonexistent or unknown.)- Returns:
- a reference to this
Throwable
instance.
-
toString
public String toString()
Returns the string representation of this exception. The string representation contains this exception's class name, its detailed messsage, 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.- Overrides:
toString
in classThrowable
- Returns:
- The non-null string representation of this exception.
- See Also:
Throwable.getMessage()
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
22/12/2024 14:59:51 Cette version de la page est en cache (à la date du 22/12/2024 14:59:51) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 30/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/security/sasl/saslexception.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.