- printf("Status: 400 Bad Request\r\n");
-
- FCGI_BeginJSON(context, STATUS_ERROR);
- FCGI_JSONPair("description", "Invalid request");
+ FCGI_RejectJSONEx(context, STATUS_ERROR, "Invalid request");
+}
+
+/**
+ * To be used when the input parameters are rejected. The return data
+ * will also have debugging information provided.
+ * @param context The context to work in
+ * @param status The status the return data should have.
+ * @param description A short description of why the input was rejected.
+ * @param params The parameters that the module handler received.
+ */
+void FCGI_RejectJSONEx(FCGIContext *context, StatusCodes status, const char *description)
+{
+ FCGI_BeginJSON(context, status);
+ FCGI_JSONPair("description", description);