mirror of
https://github.com/home-assistant/supervisor.git
synced 2026-10-01 15:53:45 +01:00
Replace the destructive_disable-argument-driven _apply_disable() with two dedicated helpers, _apply_delete() and _apply_deactivate(), so log messages and error handling can be specific to each path instead of sharing generic wording. Give every error apply_changes() can raise an error_key plus a status code matching who is actually responsible: bad client-supplied connection settings stay 400 (activation failed/timed out), a request to update an interface that does not exist or is disabled is 404, and DBus-call failures that aren't caused by anything the caller sent become 500 (APIUnknownSupervisorError) instead of the previous blanket 400. Failures that wrap a DBus error no longer interpolate the raw exception text into the client-facing message, since that unbounded text cannot be translated. Instead the full error is logged at ERROR level exactly as before, and the raised exception carries only the interface name.