pid = std::stol(a_pid);
}
- g_afb_instance->app.api_set_role(appid.c_str(), a_role, pid);
+ bool ret = g_afb_instance->app.api_set_role(appid.c_str(), a_role, pid);
+ if (!ret)
+ {
+ afb_req_fail(req, "failed", "Couldn't register");
+ return;
+ }
if (isFirstReq)
{