Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/main/java/org/folio/rest/impl/DataImportImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ public void getDataImportUploadDefinitions(String query, String totalRecords, in
Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) {
vertxContext.runOnContext(c -> {
try {
LOGGER.debug("getDataImportUploadDefinitions:: query {}", query);
LOGGER.debug("getDataImportUploadDefinitions:: getting data import UploadDefinitions");
String preparedQuery = addCreatedByConditionToCqlQuery(query, okapiHeaders);
uploadDefinitionService.getUploadDefinitions(preparedQuery, offset, limit, tenantId)
.map(GetDataImportUploadDefinitionsResponse::respond200WithApplicationJson)
.map(Response.class::cast)
.otherwise(ExceptionHelper::mapExceptionToResponse)
.onComplete(asyncResultHandler);
} catch (Exception e) {
LOGGER.warn("getDataImportUploadDefinitions:: Cannot get upload definitions by query {}", query, e);
LOGGER.warn("getDataImportUploadDefinitions:: Cannot get upload definitions by query", e);
asyncResultHandler.handle(Future.succeededFuture(ExceptionHelper.mapExceptionToResponse(e)));
}
});
Expand Down Expand Up @@ -316,7 +316,7 @@ public void getDataImportFileExtensions(String query, String totalRecords, int o
Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) {
vertxContext.runOnContext(v -> {
try {
LOGGER.debug("getDataImportFileExtensions:: query {}", query);
LOGGER.debug("getDataImportFileExtensions:: getting data import file extensions");
fileExtensionService.getFileExtensions(query, offset, limit, tenantId)
.map(GetDataImportFileExtensionsResponse::respond200WithApplicationJson)
.map(Response.class::cast)
Expand Down Expand Up @@ -603,11 +603,10 @@ protected static String getUserIdFromToken(String token) {
try {
String[] split = token.split("\\.");
String json = getJson(split[1]);
LOGGER.error(json);
JsonObject tokenJson = new JsonObject(json);
return tokenJson.getString("user_id");
} catch (Exception e) {
LOGGER.warn("getUserIdFromToken:: Invalid x-okapi-token: {}", token, e);
LOGGER.warn("getUserIdFromToken:: Invalid x-okapi-token", e);
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public Future<Void> startJob(
.onFailure(err -> {
String jobExecutionId = entity.getUploadDefinition().getMetaJobExecutionId();
if (jobExecutionId != null) {
LOGGER.warn("startJob:: File was processed with errors by jobExecutionId {}. Cause: {}", jobExecutionId, err.getCause());
LOGGER.warn("startJob:: File was processed with errors by jobExecutionId {}. Cause: {}", jobExecutionId, err.getMessage());
uploadDefinitionService.updateJobExecutionStatus(jobExecutionId, new StatusDto().withStatus(ERROR).withErrorStatus(FILE_PROCESSING_ERROR), params);
uploadDefinitionService.updateUploadDefinitionStatus(entity.getUploadDefinition().getId(), UploadDefinition.Status.ERROR, params.getTenantId())
.onFailure(errMsg -> LOGGER.error("startJob::Unable to update UploadDefinitionStatus by jobExecutionId {}. Cause: {}", jobExecutionId, errMsg));
Expand Down