@@ -215,7 +215,7 @@ public ResponseEntity<?> generate(final String msgProtocol, final String msgType
215
215
*/
216
216
public ResponseEntity <JsonObject > createResponseEntity (HttpStatus status , String responseMessage , String resultMessage ,
217
217
JsonObject errorResponse ) {
218
- initializeResponse (status , responseMessage , resultMessage , errorResponse );
218
+ initializeResponse (status , resultMessage , responseMessage , errorResponse );
219
219
return new ResponseEntity <>(errorResponse , status );
220
220
}
221
221
@@ -226,7 +226,7 @@ public ResponseEntity<JsonObject> createResponseEntity(HttpStatus status, String
226
226
* @param resultMessage whatever the result this message gives you idea about that
227
227
* @return ResponseEntity
228
228
*/
229
- public ResponseEntity <JsonObject > createResponseEntity (HttpStatus status , String responseMessage , String resultMessage ) {
229
+ public ResponseEntity <JsonObject > createResponseEntity (HttpStatus status , String resultMessage , String responseMessage ) {
230
230
return createResponseEntity (status , responseMessage , resultMessage , new JsonObject ());
231
231
}
232
232
@@ -236,7 +236,7 @@ public ResponseEntity<JsonObject> createResponseEntity(HttpStatus status, String
236
236
* @param resultMessage whatever the result this message gives you idea about that
237
237
* @param errorResponse is to collect all the responses here.
238
238
*/
239
- public void initializeResponse (HttpStatus status , String errorMessage , String resultMessage , JsonObject errorResponse ) {
239
+ public void initializeResponse (HttpStatus status , String resultMessage , String errorMessage , JsonObject errorResponse ) {
240
240
errorResponse .addProperty (JSON_STATUS_CODE , status .value ());
241
241
errorResponse .addProperty (JSON_STATUS_RESULT , resultMessage );
242
242
errorResponse .addProperty (JSON_ERROR_MESSAGE_FIELD , errorMessage );
@@ -299,7 +299,7 @@ public JsonObject processEvent(String msgProtocol, String msgType, Boolean failI
299
299
300
300
if (parsedJson .has (JSON_ERROR_MESSAGE_FIELD )) {
301
301
JsonObject eventResponse = new JsonObject ();
302
- createResponseEntity (HttpStatus .BAD_REQUEST , JSON_ERROR_STATUS , TEMPLATE_ERROR , eventResponse );
302
+ createResponseEntity (HttpStatus .BAD_REQUEST , parsedJson . toString (), JSON_ERROR_STATUS , eventResponse );
303
303
return eventResponse ;
304
304
} else {
305
305
return parsedJson ;
0 commit comments