SessionException (WebSocket 2.1 API Documentation - Apache Tomcat 10.1.57)
Description: declaration: package: jakarta.websocket, class: SessionException

# Class SessionException

java.lang.Object
java.lang.Throwable
java.lang.Exception
jakarta.websocket.SessionException

All Implemented Interfaces:
  `Serializable`

public class SessionException extends Exception
Exception thrown when an error occurs on a WebSocket session.

See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SessionException(String message, Throwable cause, Session session)`
  Creates a SessionException with the specified detail message, cause, and session.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Session`
  `getSession()`
  Returns the session on which the error occurred.

  ### Methods inherited from class Throwable

  `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### SessionException

    public SessionException(String message, Throwable cause, Session session)
    Creates a SessionException with the specified detail message, cause, and session.
    Parameters:
      `message` - The detail message
      `cause` - The underlying cause of the exception
      `session` - The session on which the error occurred

- ## Method Details

  - ### getSession

    public Session getSession()
    Returns the session on which the error occurred.
    Returns:
      The session