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>
This commit is contained in:
Jiri Peinlich
2021-11-17 23:37:51 +00:00
committed by GitHub
parent 14ca78bd42
commit a44bd7dffb

View File

@@ -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> {