Browse Source

Improved logging when creating bootstraps, and catch/log all exceptions.

rebuild-archive
CalDescent 2 years ago
parent
commit
edacce1bac
  1. 2
      src/main/java/org/qortal/api/resource/BootstrapResource.java
  2. 2
      src/main/java/org/qortal/repository/Bootstrap.java

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

@ -60,7 +60,7 @@ public class BootstrapResource {
bootstrap.validateBlockchain();
return bootstrap.create();
} catch (DataException | InterruptedException | IOException e) {
} catch (Exception e) {
LOGGER.info("Unable to create bootstrap", e);
throw ApiExceptionFactory.INSTANCE.createCustomException(request, ApiError.REPOSITORY_ISSUE, e.getMessage());
}

2
src/main/java/org/qortal/repository/Bootstrap.java

@ -279,7 +279,9 @@ public class Bootstrap {
LOGGER.info("Generating checksum file...");
String checksum = Crypto.digestHexString(compressedOutputPath.toFile(), 1024*1024);
LOGGER.info("checksum: {}", checksum);
Path checksumPath = Paths.get(String.format("%s.sha256", compressedOutputPath.toString()));
LOGGER.info("Writing checksum to path: {}", checksumPath);
Files.writeString(checksumPath, checksum, StandardOpenOption.CREATE);
// Return the path to the compressed bootstrap file

Loading…
Cancel
Save