#include "helpers.h"

using namespace std;

void sendFail(UserHandler * handler, int errorcode, string topic, string message){
    JsonDict answer;

    JsonBool b = JsonBool(false);
    JsonString s = JsonString(message);
    answer.add("success", &b);
    answer.add("reason", &s);
    handler->writeToClient(topic, &answer);
}
#include "helpers.h"

using namespace std;

void sendFail(UserHandler * handler, int errorcode, string topic, string message){
    JsonDict answer;

    JsonBool b = JsonBool(false);
    JsonString s = JsonString(message);
    JsonInt i = JsonInt(errorcode);
    answer.add("success", &b);
    answer.add("reason", &s);
    answer.add("code", &i);
    handler->writeToClient(topic, &answer);
}
Add an error code with sendFail
Add an error code with sendFail
