Feature request: add response HTTP code when there is an error
When a text is sent to HA, there is only the response text returned in the logs of wirepod.
This makes it very difficult to figure out what is happening when that response is missing, such as when the access token is wrong (401), when the request is wrong (400) or another error happens. In both these cases there's no response text at all.
Would it be possible to return the HTTP response code when there is a non-200 status code? It would help immensely in debugging issues.
https://github.com/NonaSuomy/WirePodVectorCommandHomeAssistant/blob/977aa80567ee03590c9e6f3dea9314830ae81018/README.md?plain=1#L621
Added this note, not sure about the second question, where are you seeing the html status code?
When you perform the HTTP request you will get a status code from the HA instance, or the proxy it connects to. Currently you only report the response text in the log, but with a 4xx error there won't be one, so we can't know what happened to the request. It would be nice to report the HTTP status code, as well as any possible response. So that in case of an error you can see in the logs that your request was faulty or any other status as well (like a 5xx error indicating that HA is having issues itself.)
See https://datatracker.ietf.org/doc/html/rfc7231#page-48 for the possible status codes. Note that we don't need all of these: 2xx codes indicate success, so you'd only need to add the code itself. 3xx codes should be transparent and probably won't need any special treatment either only 4xx and 5xx codes indicate errors: 4xx means the request is invalid in some way, 5xx means the responding server has issues. Those are the important ones to know about.