HfHub.Errors.HTTPError exception (HfHub v0.3.0)

Copy Markdown View Source

Base HTTP error with request and response context.

Stores metadata like request_id and server_message for debugging.

Summary

Functions

Appends additional context to the error message.

Functions

append_to_message(error, additional)

@spec append_to_message(
  %HfHub.Errors.HTTPError{
    __exception__: true,
    message: term(),
    request_id: term(),
    response: term(),
    server_message: term(),
    status: term()
  },
  String.t()
) :: %HfHub.Errors.HTTPError{
  __exception__: true,
  message: term(),
  request_id: term(),
  response: term(),
  server_message: term(),
  status: term()
}

Appends additional context to the error message.

Returns a new HTTPError with the updated message.