Browse Source

Log exceptions when publishing data updates.

qdn
CalDescent 3 years ago
parent
commit
fa696a2901
  1. 2
      src/main/java/org/qortal/api/resource/ArbitraryResource.java
  2. 4
      src/main/java/org/qortal/api/resource/WebsiteResource.java

2
src/main/java/org/qortal/api/resource/ArbitraryResource.java

@ -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);
}

4
src/main/java/org/qortal/api/resource/WebsiteResource.java

@ -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);
}

Loading…
Cancel
Save