Код: Выделить всё
public SendFSSPCommandResponse getSendFSSPCommandErrorResp() {
var error = new CommonError("500", "Didn't manage to process your request");
var errorList = new ErrorList(List.of(error));
var sendFSSPCommandResp = new SendFSSPCommandResp();
sendFSSPCommandResp.setErrorList(errorList);
var sendFSSPCommandResponse = new SendFSSPCommandResponse();
sendFSSPCommandResponse.setSendFSSPCommandResp(sendFSSPCommandResp);
return sendFSSPCommandResponse;
}
Код: Выделить всё
} catch (Exception e) {
logger.fail(null, "SendFSSPCommand", e, e.getMessage());
Log.logError(log, "Didn't manage to process your request", e);
var errorResp = suzCommandService.getSendFSSPCommandErrorResp();
return ResponseEntity.internalServerError().body(errorResp);
}
Я пытался добавить журналы и блоки try/catch:
Код: Выделить всё
public SendFSSPCommandResponse getSendFSSPCommandErrorResp() {
try {
System.out.println("Creating CommonError...");
var error = new CommonError("500", "Didn't manage to process your request");
System.out.println("CommonError: " + (error != null ? "success" : "NULL"));
System.out.println("Creating ErrorList...");
var errorList = new ErrorList(List.of(error));
System.out.println("ErrorList: " + (errorList != null ? "success" : "NULL"));
System.out.println("Creating SendFSSPCommandResp...");
var sendFSSPCommandResp = new SendFSSPCommandResp();
sendFSSPCommandResp.setErrorList(errorList);
System.out.println("SendFSSPCommandResp: " + (sendFSSPCommandResp != null ? "success" : "NULL"));
System.out.println("Creating SendFSSPCommandResponse...");
var sendFSSPCommandResponse = new SendFSSPCommandResponse();
sendFSSPCommandResponse.setSendFSSPCommandResp(sendFSSPCommandResp);
System.out.println("SendFSSPCommandResponse: " + (sendFSSPCommandResponse != null ? "success" : "NULL"));
return sendFSSPCommandResponse;
} catch (Exception e) {
System.err.println("ERROR: " + e.getMessage());
e.printStackTrace();
return null;
}
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... ts-actions
Мобильная версия