class_docstr:     HTTPError to inherit from for any custom HTTP Error raised in HF Hub.
  
      Any HTTPError is converted at least into a `HfHubHTTPError`. If some information is
      sent back by the server, it will be added to the error message.
  
      Added details:
      - Request id from "X-Request-Id" header if exists.
      - Server error message from the header "X-Error-Message".
      - Server error message if we can found one in the response body.
  
      Example:
      ```py
          import requests
          from huggingface_hub.utils import get_session, hf_raise_for_status, HfHubHTTPError
  
          response = get_session().post(...)
          try:
              hf_raise_for_status(response)
          except HfHubHTTPError as e:
              print(str(e)) # formatted message
              e.request_id, e.server_message # details returned by server
  
              # Complete the error message with additional information once it's raised
              e.append_to_message("
  `create_commit` expects the repository to exist.")
              raise
      ```
      
class_docstr_tok: ["HTTPError","to","inherit","from","for","any","custom","HTTP","Error","raised","in","HF","Hub",".","Any","HTTPError","is","converted","at","least","into","a","`","HfHubHTTPError","`",".","If","some","information","is","sent","back","by","the","server",",","it","will","be","added","to","the","error","message",".","Added","details",":","-","Request","id","from","``","X-Request-Id","''","header","if","exists",".","-","Server","error","message","from","the","header","``","X-Error-Message","''",".","-","Server","error","message","if","we","can","found","one","in","the","response","body",".","Example",":","``","`","py","import","requests","from","huggingface_hub.utils","import","get_session",",","hf_raise_for_status",",","HfHubHTTPError","response","=","get_session","(",")",".post","(","...",")","try",":","hf_raise_for_status","(","response",")","except","HfHubHTTPError","as","e",":","print","(","str","(","e",")",")","#","formatted","message","e.request_id",",","e.server_message","#","details","returned","by","server","#","Complete","the","error","message","with","additional","information","once","it","'s","raised","e.append_to_message","(","``","`","create_commit","`","expects","the","repository","to","exist",".","''",")","raise","``","`"]
docstr: Append additional information to the `HfHubHTTPError` initial message.
docstr_tok: ["Append","additional","information","to","the","`","HfHubHTTPError","`","initial","message","."]
code: def append_to_message(self, additional_message: str) -> None:
      """Append additional information to the `HfHubHTTPError` initial message."""
      self.args = (self.args[0] + additional_message,) + self.args[1:]
  
imports: import re
  from typing import Optional
  from requests import HTTPError, Response
  from ._fixes import JSONDecodeError
label_desc: Use image node_id 2 for calling the HfHubHTTPError obj's underlying member method code with example usage: obj.append_to_message(additional_message) without return types