Skip to content

fix(dashboard): accept a 404 that carries an error body - #335

Open
alanpeixinho wants to merge 1 commit into
kernelci:mainfrom
profusion:main
Open

alanpeixinho wants to merge 1 commit into
kernelci:mainfrom
profusion:main

Conversation

@alanpeixinho

Copy link
Copy Markdown
Contributor

The dashboard API will return 404 for a missing resource, with the same error field it returns as 200 today. Read that body instead of aborting, so the message, hints, and --json stay the same.

A 404 without the field still aborts. Other status codes are unchanged.

The dashboard change is kernelci/dashboard#2265. It should wait until this kci-dev release has reached most users.

@aliceinwire does this look like the right approach, or should we look for another one?

Test plan

  • 404 with {"error": "Build not found"} raises ClickException with that message
  • A non-JSON 404, a 404 without error, and a 400 still abort

Made with Cursor

A missing resource will come back as 404 with the same error field
the API returns as 200 today. Read that body instead of aborting.
A 404 without the field still fails the request.

Assisted-by: Cursor Grok 4.7
Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
@aliceinwire

Copy link
Copy Markdown
Member

we just released v0.1.13, could we wait until next release later this week?

@alanpeixinho

Copy link
Copy Markdown
Contributor Author

Hi @aliceinwire, there is no hurry in that. We expect to hold this change for many weeks, until users have naturally upgraded to newer versions.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants