10 #include "json/writer.h"
11 #include <fmt/format.h>
16 inline std::string generateJsonQuotedString(
const std::string&
string)
18 Json::String V = Json::valueToQuotedString(
string.c_str());
22 enum class JsonErrorCodes : std::int32_t {
26 METHOD_NOT_ALLOWED = 405,
30 NOT_IMPLEMENTED = 501,
32 SERVICE_UNAVAILABLE = 503,
38 return fmt::format(
"{{\n \"error\":{{\n \"code\":{},\n \"message\":{}\n }}\n}}",
39 static_cast<std::int32_t
>(code),
40 generateJsonQuotedString(message));
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
std::string generateJsonErrorResponse(JsonErrorCodes code, const std::string &message)
Definition: JsonGeneration.hpp:36