MXS-1220: Add error descriptions to REST API module commands
The module command calls that fail can now display additional information in the form of an error object.
This commit is contained in:
@ -593,7 +593,7 @@ HttpResponse cb_modulecmd(const HttpRequest& request)
|
||||
MXS_FREE(opts[i]);
|
||||
}
|
||||
|
||||
int rc = MHD_HTTP_INTERNAL_SERVER_ERROR;
|
||||
int rc;
|
||||
|
||||
if (rval)
|
||||
{
|
||||
@ -613,6 +613,11 @@ HttpResponse cb_modulecmd(const HttpRequest& request)
|
||||
rc = MHD_HTTP_NO_CONTENT;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = MHD_HTTP_FORBIDDEN;
|
||||
output = modulecmd_get_json_error();
|
||||
}
|
||||
|
||||
return HttpResponse(rc, output);
|
||||
}
|
||||
|
Reference in New Issue
Block a user