forked from Qortal/qortal
Catch runtime exceptions (e.g. IllegalStateException) when using the arbitrary data reader/writer.
This commit is contained in:
parent
95e905a5ae
commit
029c038a49
@ -278,7 +278,7 @@ public class ArbitraryResource {
|
|||||||
} catch (IOException | DataException e) {
|
} catch (IOException | DataException e) {
|
||||||
LOGGER.info("Unable to create arbitrary data file: {}", e.getMessage());
|
LOGGER.info("Unable to create arbitrary data file: {}", e.getMessage());
|
||||||
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.REPOSITORY_ISSUE);
|
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.REPOSITORY_ISSUE);
|
||||||
} catch (IllegalStateException e) {
|
} catch (RuntimeException e) {
|
||||||
LOGGER.info("Unable to create arbitrary data file: {}", e.getMessage());
|
LOGGER.info("Unable to create arbitrary data file: {}", e.getMessage());
|
||||||
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.INVALID_DATA);
|
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.INVALID_DATA);
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ public class WebsiteResource {
|
|||||||
} catch (IOException | DataException e) {
|
} catch (IOException | DataException e) {
|
||||||
LOGGER.info("Unable to create arbitrary data file: {}", e.getMessage());
|
LOGGER.info("Unable to create arbitrary data file: {}", e.getMessage());
|
||||||
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.REPOSITORY_ISSUE);
|
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.REPOSITORY_ISSUE);
|
||||||
} catch (IllegalStateException e) {
|
} catch (RuntimeException e) {
|
||||||
LOGGER.info("Unable to create arbitrary data file: {}", e.getMessage());
|
LOGGER.info("Unable to create arbitrary data file: {}", e.getMessage());
|
||||||
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.INVALID_DATA);
|
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.INVALID_DATA);
|
||||||
}
|
}
|
||||||
@ -214,7 +214,7 @@ public class WebsiteResource {
|
|||||||
} catch (IOException | DataException e) {
|
} catch (IOException | DataException e) {
|
||||||
LOGGER.info("Unable to create arbitrary data file: {}", e.getMessage());
|
LOGGER.info("Unable to create arbitrary data file: {}", e.getMessage());
|
||||||
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.REPOSITORY_ISSUE);
|
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.REPOSITORY_ISSUE);
|
||||||
} catch (IllegalStateException e) {
|
} catch (RuntimeException e) {
|
||||||
LOGGER.info("Unable to create arbitrary data file: {}", e.getMessage());
|
LOGGER.info("Unable to create arbitrary data file: {}", e.getMessage());
|
||||||
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.INVALID_DATA);
|
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.INVALID_DATA);
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ public class ArbitraryDataBuildManager implements Runnable {
|
|||||||
this.removeFromQueue(resourceId);
|
this.removeFromQueue(resourceId);
|
||||||
LOGGER.info("Finished building {}", queueItem);
|
LOGGER.info("Finished building {}", queueItem);
|
||||||
|
|
||||||
} catch (IOException | DataException e) {
|
} catch (IOException | DataException | RuntimeException e) {
|
||||||
LOGGER.info("Error building {}: {}", queueItem, e.getMessage());
|
LOGGER.info("Error building {}: {}", queueItem, e.getMessage());
|
||||||
// Something went wrong - so remove it from the queue, and add to failed builds list
|
// Something went wrong - so remove it from the queue, and add to failed builds list
|
||||||
queueItem.setFailed(true);
|
queueItem.setFailed(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user