Improve the registry lock failure error message

This commit is contained in:
Peter Palaga
2020-10-16 15:40:28 +02:00
parent f5587844cd
commit 4ae7d3ad11

View File

@@ -224,7 +224,7 @@ public class DaemonRegistry implements AutoCloseable {
}
private void doUpdate(Runnable updater) {
if (!Files.isReadable(getRegistryFile())) {
if (!Files.isReadable(registryFile)) {
throw new DaemonException("Registry became unaccessible");
}
try {
@@ -350,7 +350,8 @@ public class DaemonRegistry implements AutoCloseable {
if (currentThread().isInterrupted())
throw new InterruptedException();
else
throw new IllegalStateException("Failed to acquire lock after " + BUSY_LOCK_LIMIT / 1e9 + " seconds.");
throw new IllegalStateException("Failed to lock offset " + offset + " of " + registryFile + " within "
+ BUSY_LOCK_LIMIT / 1e9 + " seconds.");
}
public void unlockLong(long offset) throws IllegalMonitorStateException {