1. 01 Dec, 2025 1 commit
    • Bruce MacDonald's avatar
      api/client: handle non-json streaming errors (#13007) · 5b6a8e60
      Bruce MacDonald authored
      While processing the response stream during a chat or generation if an error is occurred it is parsed and returned to the user. The issue with the existing code is that this assumed the response would be valid JSON, which is not a safe assumption and caused cryptic error messages to be displayed due to parsing failures:
      `invalid character 'i' looking for beginning of value`
      
      This change updates the stream function to return the raw error string if it cant be parsed as JSON. This should help with debugging issues by making sure the actual error reaches the user.
      5b6a8e60
  2. 16 Jul, 2025 1 commit
    • Bruce MacDonald's avatar
      api: fix unreachable status err (#11423) · 92c2e8a5
      Bruce MacDonald authored
      StatusError was unreachable, the client always checked for error messages in the response body first, and the server always includes error messages with HTTP error status codes.
      92c2e8a5
  3. 08 May, 2025 1 commit
  4. 20 Feb, 2025 1 commit
    • Bruce MacDonald's avatar
      api: document client stream behavior with a test (#8996) · 14b5a9a1
      Bruce MacDonald authored
      Added unit tests to verify error handling behavior in the Client.stream and Client.do methods.
      Tests cover various error scenarios including:
      - Error responses with status codes >= 400
      - Error messages with successful status codes
      - Empty error messages
      - Successful responses
      14b5a9a1
  5. 22 Jul, 2024 1 commit
  6. 12 Jun, 2024 1 commit
  7. 29 Apr, 2024 1 commit
  8. 26 Oct, 2023 1 commit