Skip to content

Improve errors for unauthenticated requests #273

@jackwotherspoon

Description

@jackwotherspoon

Prerequisites

What are you trying to do that currently feels hard or impossible?

If you deploy Toolbox to Cloud Run as a service thats requires authentication and then try to connect using the SDK without authentication, the error that is returned is not great.

  File "/Users/jackwoth/dev/adk-samples/python/agents/software-bug-assistant/.venv/lib/python3.13/site-packages/toolbox_core/client.py", line 197, in load_toolset
    json = await response.json()
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jackwoth/dev/adk-samples/python/agents/software-bug-assistant/.venv/lib/python3.13/site-packages/aiohttp/client_reqrep.py", line 734, in json
    raise ContentTypeError(
    ...<7 lines>...
    )
aiohttp.client_exceptions.ContentTypeError: 403, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url='https://toolbox-669006305285.us-central1.run.app/api/toolset/tickets_toolset'

Suggested Solution(s)

Improve error message to say something about requiring authentication or unauthenticated request.

Alternatives Considered

No response

Additional Details

No response

Metadata

Metadata

Assignees

Labels

priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions