We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 09224ee commit e75b21fCopy full SHA for e75b21f
src/daemon/state.cpp
@@ -208,7 +208,12 @@ bool Device::loadState(string path) {
208
f.open(path+S(".json"));
209
210
if (f.is_open()) {
211
- f>>data;
+ try {
212
+ f>>data;
213
+ } catch (nlohmann::detail::parse_error& e) {
214
+ imLogE("error while loading device state: %s\n",e.what());
215
+ return false;
216
+ }
217
} else {
218
// load default state...
219
mappings.push_back(new bindSet("Default"));
@@ -273,7 +278,12 @@ bool loadMacros(string path) {
273
278
f.open(path);
274
279
275
280
276
281
282
283
284
+ imLogE("error while loading macros: %s\n",e.what());
285
286
277
287
288
imLogI("macros will be saved.\n");
289
return false;
0 commit comments