Enum Class ErrorCategory

java.lang.Object
java.lang.Enum<ErrorCategory>
com.tnsai.observability.errors.ErrorCategory
All Implemented Interfaces:
Serializable, Comparable<ErrorCategory>, Constable

public enum ErrorCategory extends Enum<ErrorCategory>
Coarse classification of errors for routing, alerting, and budget tracking.

Each error reported via ErrorEmitter carries an ErrorCategory so dashboards can group "transient network blips" separately from "persistent auth failures" and operators can wire different alert/escalation policies per category.

Since:
0.5.0 (issue #86)
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Misconfiguration — missing LLM, wrong model name, malformed role spec.
    Third-party system failure — MCP server down, webhook 5xx, DB unavailable.
    Framework-internal bug — should not happen in production.
    Assertion / invariant violation — internal logic bug, illegal state.
    Will not succeed on retry — bad credentials, invalid request, unsupported model.
    Exhausted resource — token budget, rate limit, capacity, disk full.
    Blocked by policy — content filter, prompt injection detector, approval denied.
    Will likely succeed on retry — network blip, overloaded model, transient 5xx.
    Could not classify — defensive fallback.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this class with the specified name.
    static ErrorCategory[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Enum

    compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • TRANSIENT

      public static final ErrorCategory TRANSIENT
      Will likely succeed on retry — network blip, overloaded model, transient 5xx.
    • PERMANENT

      public static final ErrorCategory PERMANENT
      Will not succeed on retry — bad credentials, invalid request, unsupported model.
    • SECURITY

      public static final ErrorCategory SECURITY
      Blocked by policy — content filter, prompt injection detector, approval denied.
    • CONFIG

      public static final ErrorCategory CONFIG
      Misconfiguration — missing LLM, wrong model name, malformed role spec.
    • RESOURCE

      public static final ErrorCategory RESOURCE
      Exhausted resource — token budget, rate limit, capacity, disk full.
    • LOGIC

      public static final ErrorCategory LOGIC
      Assertion / invariant violation — internal logic bug, illegal state.
    • EXTERNAL

      public static final ErrorCategory EXTERNAL
      Third-party system failure — MCP server down, webhook 5xx, DB unavailable.
    • INTERNAL

      public static final ErrorCategory INTERNAL
      Framework-internal bug — should not happen in production.
    • UNKNOWN

      public static final ErrorCategory UNKNOWN
      Could not classify — defensive fallback.
  • Method Details

    • values

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

      public static ErrorCategory valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null