mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 12:33:44 +02:00
Make parse failure of local.conf non-fatal in case people have ancient files sitting around.
This commit is contained in:
parent
2e5de46584
commit
40078a99de
1 changed files with 2 additions and 8 deletions
|
@ -847,16 +847,10 @@ public:
|
||||||
try {
|
try {
|
||||||
_localConfig = json::parse(lcbuf);
|
_localConfig = json::parse(lcbuf);
|
||||||
if (!_localConfig.is_object()) {
|
if (!_localConfig.is_object()) {
|
||||||
Mutex::Lock _l(_termReason_m);
|
fprintf(stderr,"WARNING: unable to parse local.conf (root element is not a JSON object)" ZT_EOL_S);
|
||||||
_termReason = ONE_UNRECOVERABLE_ERROR;
|
|
||||||
_fatalErrorMessage = "invalid local.conf (content is not JSON object)";
|
|
||||||
return _termReason;
|
|
||||||
}
|
}
|
||||||
} catch ( ... ) {
|
} catch ( ... ) {
|
||||||
Mutex::Lock _l(_termReason_m);
|
fprintf(stderr,"WARNING: unable to parse local.conf (invalid JSON)" ZT_EOL_S);
|
||||||
_termReason = ONE_UNRECOVERABLE_ERROR;
|
|
||||||
_fatalErrorMessage = "invalid local.conf (JSON parse error)";
|
|
||||||
return _termReason;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue