Skip to content

Commit

Permalink
audio: print other HTTP errors on screen
Browse files Browse the repository at this point in the history
We already explicitly handle HTTP 401 and 406 from WIS, but we don't
print anything to the screen when we hit e.g. a 403 or 404. Handle these
with a generic message printed to the screen, so the user has some
indication about what is going on. Also trigger the configured audio
response.
  • Loading branch information
stintel committed Nov 28, 2023
1 parent 648ffdc commit 9997684
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main/audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,13 @@ static esp_err_t hdl_ev_hs_to_api(http_stream_event_msg_t *msg)
ESP_LOGE(TAG, "WIS returned Unauthorized Speaker");
ui_pr_err("Unauthorized Speaker", NULL);
war.fn_err("Unauthorized Speaker");
} else {
ESP_LOGE(TAG, "WIS returned HTTP error: %d", http_status);
char str_http_err[14];
snprintf(str_http_err, 14, "WIS HTTP %d", http_status);
ui_pr_err(str_http_err, NULL);
war.fn_err(str_http_err);
}
ESP_LOGE(TAG, "WIS returned HTTP error: %d", http_status);
return ESP_FAIL;
}
// Allocate memory for response. Should be enough?
Expand Down

0 comments on commit 9997684

Please sign in to comment.