ErrorNumbers.SVC_NO_SERVER_RESOURCES, null, version);
msoRequest.createErrorRequestRecord(Status.FAILED, requestId,
- "Exception while communciate with " + "Catalog DB", action, ModelType.service.name(), requestJSON);
+ "Exception while communciate with " + "Catalog DB", action, ModelType.service.name(), requestJSON,
+ null);
logger.debug(END_OF_THE_TRANSACTION + response.getEntity());
return response;
}
ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null, version);
msoRequest.createErrorRequestRecord(Status.FAILED, requestId, "Recipe does not exist in catalog DB", action,
- ModelType.service.name(), requestJSON);
+ ModelType.service.name(), requestJSON, null);
logger.debug(END_OF_THE_TRANSACTION + response.getEntity());
return response;
}
ErrorNumbers.SVC_NO_SERVER_RESOURCES, null, version);
msoRequest.createErrorRequestRecord(Status.FAILED, requestId,
- "Exception while communciate with " + "Catalog DB", action, ModelType.service.name(), requestJSON);
+ "Exception while communciate with " + "Catalog DB", action, ModelType.service.name(), requestJSON,
+ null);
logger.debug(END_OF_THE_TRANSACTION + response.getEntity());
return response;
}
ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null, version);
msoRequest.createErrorRequestRecord(Status.FAILED, requestId, "Recipe does not exist in catalog DB", action,
- ModelType.service.name(), requestJSON);
+ ModelType.service.name(), requestJSON, null);
logger.debug(END_OF_THE_TRANSACTION + response.getEntity());
return response;
}
ErrorNumbers.SVC_NO_SERVER_RESOURCES, null, version);
msoRequest.createErrorRequestRecord(Status.FAILED, requestId,
- "No communication to catalog DB " + e.getMessage(), action, ModelType.service.name(), requestJSON);
+ "No communication to catalog DB " + e.getMessage(), action, ModelType.service.name(), requestJSON,
+ null);
logger.debug(END_OF_THE_TRANSACTION + response.getEntity());
return response;
}
MsoException.ServiceException, "Recipe does not exist in catalog DB",
ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null, version);
msoRequest.createErrorRequestRecord(Status.FAILED, requestId, "No recipe found in DB", action,
- ModelType.service.name(), requestJSON);
+ ModelType.service.name(), requestJSON, null);
logger.debug(END_OF_THE_TRANSACTION + response.getEntity());
return response;
}
ErrorNumbers.SVC_BAD_PARAMETER).cause(e).errorInfo(errorLoggerInfo).build();
msoRequest.createErrorRequestRecord(Status.FAILED, requestId, validateException.getMessage(), action,
- ModelType.service.name(), requestJSON);
+ ModelType.service.name(), requestJSON, null);
throw validateException;
}
}
public void createErrorRequestRecord(Status status, String requestId, String errorMessage, Actions action,
- String requestScope, String requestJSON) {
+ String requestScope, String requestJSON, String serviceInstanceId) {
try {
InfraActiveRequests request = new InfraActiveRequests(requestId);
Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());
request.setRequestAction(action.toString());
request.setRequestScope(requestScope);
request.setRequestBody(requestJSON);
+ if (serviceInstanceId != null) {
+ request.setServiceInstanceId(serviceInstanceId);
+ }
Timestamp endTimeStamp = new Timestamp(System.currentTimeMillis());
request.setEndTime(endTimeStamp);
request.setRequestUrl(MDC.get(LogConstants.HTTP_URL));
sir = requestHandlerUtils.convertJsonToServiceInstanceRequest(requestJSON, action, requestId, requestUri);
action = handleReplaceInstance(action, sir);
- requestValidatorListenerRunner.runValidations(requestUri, instanceIdMap, sir, queryParams, action);
String requestScope = requestHandlerUtils.deriveRequestScope(action, sir, requestUri);
+ try {
+ requestValidatorListenerRunner.runValidations(requestUri, instanceIdMap, sir, queryParams, action);
+ } catch (ApiException e) {
+ msoRequest.createErrorRequestRecord(Status.FAILED, requestId, e.getMessage(), action, requestScope,
+ requestJSON, sir.getServiceInstanceId());
+ throw e;
+ }
+
InfraActiveRequests currentActiveReq =
msoRequest.createRequestObject(sir, action, requestId, Status.IN_PROGRESS, requestJSON, requestScope);
if (sir.getRequestDetails().getRequestParameters() != null) {