Log exceptions when publishing data updates.

This commit is contained in:
CalDescent 2021-08-15 18:37:27 +01:00
parent f5615b1c54
commit fa696a2901
2 changed files with 6 additions and 0 deletions

View File

@ -276,8 +276,10 @@ public class ArbitraryResource {
try {
arbitraryDataWriter.save();
} catch (IOException | DataException e) {
LOGGER.info("Unable to create arbitrary data file: {}", e.getMessage());
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.REPOSITORY_ISSUE);
} catch (IllegalStateException e) {
LOGGER.info("Unable to create arbitrary data file: {}", e.getMessage());
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.INVALID_DATA);
}

View File

@ -107,8 +107,10 @@ public class WebsiteResource {
try {
arbitraryDataWriter.save();
} catch (IOException | DataException e) {
LOGGER.info("Unable to create arbitrary data file: {}", e.getMessage());
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.REPOSITORY_ISSUE);
} catch (IllegalStateException e) {
LOGGER.info("Unable to create arbitrary data file: {}", e.getMessage());
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.INVALID_DATA);
}
@ -207,8 +209,10 @@ public class WebsiteResource {
try {
arbitraryDataWriter.save();
} catch (IOException | DataException e) {
LOGGER.info("Unable to create arbitrary data file: {}", e.getMessage());
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.REPOSITORY_ISSUE);
} catch (IllegalStateException e) {
LOGGER.info("Unable to create arbitrary data file: {}", e.getMessage());
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.INVALID_DATA);
}