From e9b49a9ddd5e7098b2804bc1799fb7d6789c7f00 Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Tue, 5 Jul 2022 02:19:32 +0530 Subject: [PATCH] [ESP32] Map ESP_ERR_NVS_INVALID_LENGTH to CHIP_ERROR_BUFFER_TOO_SMALL (#20211) --- src/platform/ESP32/ESP32Utils.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/platform/ESP32/ESP32Utils.cpp b/src/platform/ESP32/ESP32Utils.cpp index 91d3352cc8fcf5..9391ee586e3eb6 100644 --- a/src/platform/ESP32/ESP32Utils.cpp +++ b/src/platform/ESP32/ESP32Utils.cpp @@ -331,6 +331,10 @@ CHIP_ERROR ESP32Utils::MapError(esp_err_t error) { return CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; } + if (error == ESP_ERR_NVS_INVALID_LENGTH) + { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } return CHIP_ERROR(ChipError::Range::kPlatform, error); }