Adding filechannel name to the exception (#3064)

Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com>

Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
pull/3087/head
Jiri Peinlich 3 years ago committed by GitHub
parent 14ca78bd42
commit a44bd7dffb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      services/tasks/src/main/java/org/hyperledger/besu/services/tasks/FlatFileTaskCollection.java

@ -89,7 +89,8 @@ public class FlatFileTaskCollection<T> implements TaskCollection<T> {
StandardOpenOption.WRITE,
StandardOpenOption.CREATE);
} catch (final IOException e) {
throw new StorageException(e);
throw new StorageException(
"There was a problem opening FileChannel " + pathForFileNumber(fileNumber), e);
}
}
@ -106,7 +107,8 @@ public class FlatFileTaskCollection<T> implements TaskCollection<T> {
writeFileChannel = openWriteFileChannel(writeFileNumber);
}
} catch (final IOException e) {
throw new StorageException(e);
throw new StorageException(
"There was a problem adding to FileChannel " + pathForFileNumber(writeFileNumber), e);
}
}
@ -123,7 +125,8 @@ public class FlatFileTaskCollection<T> implements TaskCollection<T> {
size--;
return task;
} catch (final IOException e) {
throw new StorageException(e);
throw new StorageException(
"There was a problem removing from FileChannel " + pathForFileNumber(readFileNumber), e);
}
}
@ -249,6 +252,10 @@ public class FlatFileTaskCollection<T> implements TaskCollection<T> {
StorageException(final Throwable t) {
super(t);
}
StorageException(final String m, final Throwable t) {
super(m, t);
}
}
private static class FlatFileTask<T> implements Task<T> {

Loading…
Cancel
Save