ErrorState (Apache Tomcat 10.1.57 API Documentation)
Description: declaration: package: org.apache.coyote, enum: ErrorState

# Enum ErrorState

java.lang.Object
java.lang.Enum<ErrorState>
org.apache.coyote.ErrorState

All Implemented Interfaces:
  `Serializable, Comparable<ErrorState>, java.lang.constant.Constable`

public enum ErrorState extends Enum<ErrorState>
Enumeration of possible error states for a Coyote connection or request/response.

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from class Enum

  `Enum.EnumDesc<E>`

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `CLOSE_CLEAN`
  The current request/response is in an error state and while it is safe to complete the current response it is not safe to continue to use the existing connection which must be closed once the response has been completed.
  `CLOSE_CONNECTION_NOW`
  An error has been detected that impacts the underlying network connection.
  `CLOSE_NOW`
  The current request/response is in an error state and it is not safe to continue to use them.
  `NONE`
  Not in an error state.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ErrorState`
  `getMostSevere(ErrorState input)`
  Compare this ErrorState with the provided ErrorState and return the most severe.
  `boolean`
  `isConnectionIoAllowed()`
  Returns whether connection-level I/O operations are still allowed in this error state.
  `boolean`
  `isError()`
  Returns whether this error state represents an error condition.
  `boolean`
  `isIoAllowed()`
  Returns whether I/O operations are still allowed in this error state.
  `static ErrorState`
  `valueOf(String name)`
  Returns the enum constant of this type with the specified name.
  `static ErrorState[]`
  `values()`
  Returns an array containing the constants of this enum type, in the order they are declared.

  ### Methods inherited from class Enum

  `clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

  ### Methods inherited from class Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Enum Constant Details

  - ### NONE

    public static final ErrorState NONE
    Not in an error state.

  - ### CLOSE_CLEAN

    public static final ErrorState CLOSE_CLEAN
    The current request/response is in an error state and while it is safe to complete the current response it is not safe to continue to use the existing connection which must be closed once the response has been completed. For multiplexed protocols, the channel must be closed when the current request/response completes but the connection may continue.

  - ### CLOSE_NOW

    public static final ErrorState CLOSE_NOW
    The current request/response is in an error state and it is not safe to continue to use them. For multiplexed protocols (such as HTTP/2) the stream/channel must be closed immediately but the connection may continue. For non-multiplexed protocols (AJP, HTTP/1.x) the current connection must be closed.

  - ### CLOSE_CONNECTION_NOW

    public static final ErrorState CLOSE_CONNECTION_NOW
    An error has been detected that impacts the underlying network connection. It is not safe to continue using the network connection which must be closed immediately. For multiplexed protocols (such as HTTP/2) this impacts all multiplexed channels.

- ## Method Details

  - ### values

    public static ErrorState[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.
    Returns:
      an array containing the constants of this enum type, in the order they are declared

  - ### valueOf

    public static ErrorState valueOf(String name)
    Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
    Parameters:
      `name` - the name of the enum constant to be returned.
    Returns:
      the enum constant with the specified name
    Throws:
      `IllegalArgumentException` - if this enum type has no constant with the specified name
      `NullPointerException` - if the argument is null

  - ### isError

    public boolean isError()
    Returns whether this error state represents an error condition.
    Returns:
      `true` if in an error state

  - ### getMostSevere

    public ErrorState getMostSevere(ErrorState input)
    Compare this ErrorState with the provided ErrorState and return the most severe.
    Parameters:
      `input` - The error state to compare to this one
    Returns:
      The most severe error state from the provided error state and this one

  - ### isIoAllowed

    public boolean isIoAllowed()
    Returns whether I/O operations are still allowed in this error state.
    Returns:
      `true` if I/O is allowed

  - ### isConnectionIoAllowed

    public boolean isConnectionIoAllowed()
    Returns whether connection-level I/O operations are still allowed in this error state.
    Returns:
      `true` if connection I/O is allowed