Fix failure status bug: when status is failure, request should be stopped

Change-Id: I699d9ae6bdc34ac67d9a8b3c69e9d789f9709c6d
diff --git a/src/json-helper.cpp b/src/json-helper.cpp
index 78969fc..81fa829 100644
--- a/src/json-helper.cpp
+++ b/src/json-helper.cpp
@@ -69,11 +69,14 @@
 }
 
 const JsonSection
-genErrorJson(const std::string& errorInfo)
+genFailureJson(const std::string& requestId, const std::string& challengeType,
+               const std::string& status, const std::string& failureInfo)
 {
   JsonSection root;
-  root.put(JSON_STATUS, "error");
-  root.put(JSON_ERROR_INFO, errorInfo);
+  root.put(JSON_REQUEST_ID, requestId);
+  root.put(JSON_CHALLENGE_TYPE, challengeType);
+  root.put(JSON_STATUS, status);
+  root.put(JSON_FAILURE_INFO, failureInfo);
   return root;
 }