mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-03 12:44:33 +02:00
Merge branch 'bugfix/esp_https_ota_v4.3' into 'release/v4.3'
esp_https_ota: Add check for HTTP error codes and documentation updates (v4.3) See merge request espressif/esp-idf!14206
This commit is contained in:
@@ -151,6 +151,7 @@ typedef enum {
|
|||||||
HttpStatus_TemporaryRedirect = 307,
|
HttpStatus_TemporaryRedirect = 307,
|
||||||
|
|
||||||
/* 4xx - Client Error */
|
/* 4xx - Client Error */
|
||||||
|
HttpStatus_BadRequest = 400,
|
||||||
HttpStatus_Unauthorized = 401,
|
HttpStatus_Unauthorized = 401,
|
||||||
HttpStatus_Forbidden = 403,
|
HttpStatus_Forbidden = 403,
|
||||||
HttpStatus_NotFound = 404,
|
HttpStatus_NotFound = 404,
|
||||||
|
@@ -73,8 +73,11 @@ static esp_err_t _http_handle_response_code(esp_http_client_handle_t http_client
|
|||||||
} else if(status_code == HttpStatus_NotFound || status_code == HttpStatus_Forbidden) {
|
} else if(status_code == HttpStatus_NotFound || status_code == HttpStatus_Forbidden) {
|
||||||
ESP_LOGE(TAG, "File not found(%d)", status_code);
|
ESP_LOGE(TAG, "File not found(%d)", status_code);
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
} else if (status_code == HttpStatus_InternalError) {
|
} else if (status_code >= HttpStatus_BadRequest && status_code < HttpStatus_InternalError) {
|
||||||
ESP_LOGE(TAG, "Server error occurred(%d)", status_code);
|
ESP_LOGE(TAG, "Client error (%d)", status_code);
|
||||||
|
return ESP_FAIL;
|
||||||
|
} else if (status_code >= HttpStatus_InternalError) {
|
||||||
|
ESP_LOGE(TAG, "Server error (%d)", status_code);
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user