Skip to content

Conversation

@cogneato
Copy link

Improve error message clarity by specifying to check supervisor logs with 'ha supervisor logs'

Proposed change

Type of change

This addresses a common user experience issue where users don't understand what to do when they see "Unknown error, see supervisor" messages.

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to the supervisor)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to cli pull request:
  • Link to client library pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Ruff (ruff format supervisor tests)
  • Tests have been added to verify that the new code works.

If API endpoints or add-on configuration are added/changed:

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves error message clarity by providing specific instructions for users to check supervisor logs. Instead of the vague "Unknown error, see supervisor" message, users now receive actionable guidance with the specific command to run.

Key changes:

  • Enhanced default error messages to include the CLI command 'ha supervisor logs'
  • Updated error handling across API utilities and job management system
  • Ensured consistent messaging for unknown errors throughout the codebase

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
supervisor/api/utils.py Updated default error message in API error handling to include specific CLI command
supervisor/jobs/init.py Enhanced SupervisorJobError default message with actionable instruction
tests/jobs/test_job_manager.py Updated test assertions to match new error message format

@sairon sairon added the chore label Oct 14, 2025
Copy link
Member

@sairon sairon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I've fixed the linter error and changed it to "Supervisor" for consistency with other texts.

Copy link
Contributor

@mdegat01 mdegat01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Only thought, do we want to suggest they use the CLI here or include a my link to supervisor logs like https://my.home-assistant.io/redirect/logs/?provider=supervisor?

@agners
Copy link
Member

agners commented Oct 23, 2025

Nice! Only thought, do we want to suggest they use the CLI here or include a my link to supervisor logs like https://my.home-assistant.io/redirect/logs/?provider=supervisor?

Yeah I was going to say, the more user friendly version are the logs available through the frontend, so we probably should suggest those primarily 🤔? it seems that nowadays they are shown even without Advanced mode, so everyone should be able to navigate there. The problem is that navigation changed at one point, but I think it did not the last 2 years so at least right now it should be the same for all users of the latest Supervisor version (Settings > System > Logs > Select "Supervisor" in the top right menu).

But maybe instead just get rid of the unspecific error in more/all cases? Do you happen to have a concrete case in which people run into commonly we could improve?

@mdegat01
Copy link
Contributor

@agners That's why I suggested a my link. It doesn't matter what the navigation is now, it'll just open the Supervisor logs in the UI wherever we're putting them now.

@agners
Copy link
Member

agners commented Oct 28, 2025

@agners That's why I suggested a my link. It doesn't matter what the navigation is now, it'll just open the Supervisor logs in the UI wherever we're putting them now.

Yeah, but those exceptions get raised and pop up as a message on the bottom left. We can't use my links straight in the exception message.

We'd have to catch the exception and present it somehow differently in the frontend I guess 🤔

@mdegat01
Copy link
Contributor

So leave it as a CLI direction then? If it just pops up as a toast they won't be able to copy and paste that. But there's a better chance they'll remember ha supervisor logs then a long URL.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants