improve error handling, fix crash on empty /api URL

This commit is contained in:
proddy
2021-11-10 12:26:29 +01:00
parent e821e8d082
commit 5f2a9b093d
3 changed files with 112 additions and 112 deletions

View File

@@ -139,7 +139,13 @@ class Command {
private:
static uuid::log::Logger logger_;
static std::vector<CmdFunction> cmdfunctions_; // list of commands
static std::vector<CmdFunction> cmdfunctions_; // the list of commands
inline static uint8_t message(uint8_t error_code, const char * message, JsonObject & output) {
output.clear();
output["message"] = (const char *)message;
return error_code;
}
};
typedef std::unordered_map<std::string, std::string> KeyValueMap_t;