mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 15:32:52 +02:00
controlapi/config: simplify error handling
Origin commit data
------------------
Branch: ni/coolstream
Commit: e407ef5a98
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-02-20 (Sat, 20 Feb 2016)
Origin message was:
------------------
- controlapi/config: simplify error handling
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -3045,9 +3045,7 @@ void CControlAPI::ConfigCGI(CyhookHandler *hh) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(!configFileName.empty())
|
if(!configFileName.empty())
|
||||||
error = string_printf("no config defined for: %s", (hh->ParamList["config"]).c_str());
|
error = string_printf("no config defined for %s", (hh->ParamList["config"]).c_str());
|
||||||
else
|
|
||||||
error = "no config given";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// write footer
|
// write footer
|
||||||
@@ -3059,14 +3057,8 @@ void CControlAPI::ConfigCGI(CyhookHandler *hh) {
|
|||||||
hh->WriteLn(hh->outCollection("config", result));
|
hh->WriteLn(hh->outCollection("config", result));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
if (outType == json) {
|
hh->SendError(error);
|
||||||
hh->WriteLn(json_out_error(error));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
hh->SendError();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
delete Config;
|
delete Config;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user