Class HttpException

All Implemented Interfaces:
Serializable

public class HttpException extends LangChain4jException
Represents an HTTP-level error returned by a model provider.

Carries the raw HTTP status code alongside the error message so that higher-level error mappers (such as ExceptionMapper) can translate specific codes into more descriptive exceptions (e.g. 429 → RateLimitException, 401 → AuthenticationException).

This class is typically not thrown directly by user-facing APIs; it is an intermediate representation that the HTTP client layer produces before the exception mapper converts it to a more specific type.

See Also:
  • Constructor Details

    • HttpException

      public HttpException(int statusCode, String message)
  • Method Details

    • statusCode

      public int statusCode()