@@ -130,35 +130,19 @@ CHIP_ERROR KeyValueStoreManagerImpl::Init()
130
130
CHIP_ERROR err = CHIP_NO_ERROR;
131
131
132
132
err = sKeysStorage .Init (Internal::RamStorage::kRamBufferInitialSize );
133
- if (err != CHIP_NO_ERROR)
134
- {
135
- ChipLogProgress (DeviceLayer, " Cannot init KVS keys storage with id: %d. Error: %s" , kNvmId_KvsKeys , ErrorStr (err));
136
- }
133
+ ReturnErrorOnFailure (err);
137
134
138
135
err = sValuesStorage .Init (Internal::RamStorage::kRamBufferInitialSize , true );
139
- if (err != CHIP_NO_ERROR)
140
- {
141
- ChipLogProgress (DeviceLayer, " Cannot init KVS values storage with id: %d. Error: %s" , kNvmId_KvsValues , ErrorStr (err));
142
- }
136
+ ReturnErrorOnFailure (err);
143
137
144
138
err = sSubscriptionStorage .Init (Internal::RamStorage::kRamBufferInitialSize );
145
- if (err != CHIP_NO_ERROR)
146
- {
147
- ChipLogProgress (DeviceLayer, " Cannot init KVS subscription storage with id: %d. Error: %s" , kNvmId_KvsSubscription ,
148
- ErrorStr (err));
149
- }
139
+ ReturnErrorOnFailure (err);
150
140
151
141
err = sGroupsStorage .Init (Internal::RamStorage::kRamBufferInitialSize , true );
152
- if (err != CHIP_NO_ERROR)
153
- {
154
- ChipLogProgress (DeviceLayer, " Cannot init KVS groups storage with id: %d. Error: %s" , kNvmId_KvsGroups , ErrorStr (err));
155
- }
142
+ ReturnErrorOnFailure (err);
156
143
157
144
err = sAclStorage .Init (Internal::RamStorage::kRamBufferInitialSize , true );
158
- if (err != CHIP_NO_ERROR)
159
- {
160
- ChipLogProgress (DeviceLayer, " Cannot init KVS acl storage with id: %d. Error: %s" , kNvmId_KvsAcl , ErrorStr (err));
161
- }
145
+ ReturnErrorOnFailure (err);
162
146
163
147
#if CONFIG_CHIP_K32W0_KVS_MOVE_KEYS_TO_SPECIFIC_STORAGE
164
148
ChipLogProgress (DeviceLayer, " Moving some keys to dedicated storage" );
0 commit comments