ChannelException (Apache Tomcat 9.0.111 API Documentation)
Description: declaration: package: org.apache.catalina.tribes, class: ChannelException

# Class ChannelException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.catalina.tribes.ChannelException

All Implemented Interfaces:
  `Serializable`

public class ChannelException extends Exception
A channel exception is thrown when an internal error happens somewhere in the channel.

When a global error happens, the cause can be retrieved using `getCause()`.

If an application is sending a message and some of the recipients fail to receive it, the application can retrieve what recipients failed by using the `getFaultyMembers()` method. This way, an application will always know if a message was delivered successfully or not.

See Also:
  - Serialized Form

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `ChannelException.FaultyMember`
  Represent a failure to a specific member when a message was sent to more than one member

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected static final ChannelException.FaultyMember[]`
  `EMPTY_LIST`
  Empty list to avoid reinstantiating lists

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ChannelException()`
  Constructor, creates a ChannelException
  `ChannelException(String message)`
  Constructor, creates a ChannelException with an error message
  `ChannelException(String message, Throwable cause)`
  Constructor, creates a ChannelException with an error message and a cause
  `ChannelException(Throwable cause)`
  Constructor, creates a ChannelException with a cause

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `addFaultyMember(ChannelException.FaultyMember mbr)`
  Adds a faulty member
  `int`
  `addFaultyMember(ChannelException.FaultyMember[] mbrs)`
  Adds a list of faulty members
  `boolean`
  `addFaultyMember(Member mbr, Exception x)`
  Adds a faulty member, and the reason the member failed.
  `ChannelException.FaultyMember[]`
  `getFaultyMembers()`
  Returns an array of members that failed and the reason they failed.
  `String`
  `getMessage()`
  Returns the message for this exception

  ### Methods inherited from class Throwable

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

  ### Methods inherited from class Object

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

- ## Field Details

  - ### EMPTY_LIST

    protected static final ChannelException.FaultyMember[] EMPTY_LIST
    Empty list to avoid reinstantiating lists

- ## Constructor Details

  - ### ChannelException

    public ChannelException()
    Constructor, creates a ChannelException
    See Also:
      - `Exception()`

  - ### ChannelException

    public ChannelException(String message)
    Constructor, creates a ChannelException with an error message
    Parameters:
      `message` - The error message
    See Also:
      - `Exception(String)`

  - ### ChannelException

    public ChannelException(String message, Throwable cause)
    Constructor, creates a ChannelException with an error message and a cause
    Parameters:
      `message` - The error message
      `cause` - Throwable
    See Also:
      - `Exception(String,Throwable)`

  - ### ChannelException

    public ChannelException(Throwable cause)
    Constructor, creates a ChannelException with a cause
    Parameters:
      `cause` - Throwable
    See Also:
      - `Exception(Throwable)`

- ## Method Details

  - ### getMessage

    public String getMessage()
    Returns the message for this exception
    Overrides:
      `getMessage` in class `Throwable`
    Returns:
      the error message
    See Also:
      - `Throwable.getMessage()`

  - ### addFaultyMember

    public boolean addFaultyMember(Member mbr, Exception x)
    Adds a faulty member, and the reason the member failed.
    Parameters:
      `mbr` - Member
      `x` - Exception
    Returns:
      `true` if the member was added

  - ### addFaultyMember

    public int addFaultyMember(ChannelException.FaultyMember[] mbrs)
    Adds a list of faulty members
    Parameters:
      `mbrs` - FaultyMember[]
    Returns:
      the number of members added

  - ### addFaultyMember

    public boolean addFaultyMember(ChannelException.FaultyMember mbr)
    Adds a faulty member
    Parameters:
      `mbr` - FaultyMember
    Returns:
      `true` if the member was added

  - ### getFaultyMembers

    public ChannelException.FaultyMember[] getFaultyMembers()
    Returns an array of members that failed and the reason they failed.
    Returns:
      FaultyMember[]