Skip to content

Commit

Permalink
Logs some i/o-related exceptions in the storage log ✍️
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobvogel committed Sep 18, 2023
1 parent 2cc85ad commit 53630bb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/ninja/Bucket.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public boolean delete() {
sirius.kernel.commons.Files.delete(folder.toPath());
return true;
} catch (IOException e) {
Exceptions.handle(e);
Exceptions.handle(Storage.LOG, e);
return false;
}
}
Expand Down Expand Up @@ -190,7 +190,7 @@ public void outputObjectsV1(XMLStructuredOutput output,
try {
walkFileTreeOurWay(folder.toPath(), visitor);
} catch (IOException e) {
throw Exceptions.handle(e);
throw Exceptions.handle(Storage.LOG, e);
}
output.property("IsTruncated", limit > 0 && visitor.getCount() > limit);
output.endOutput();
Expand Down Expand Up @@ -219,7 +219,7 @@ public void outputObjectsV2(XMLStructuredOutput output,
try {
walkFileTreeOurWay(folder.toPath(), visitor);
} catch (IOException e) {
throw Exceptions.handle(e);
throw Exceptions.handle(Storage.LOG, e);
}
output.property("IsTruncated", limit > 0 && visitor.getCount() > limit);
output.property("KeyCount", visitor.getCount());
Expand All @@ -244,7 +244,7 @@ private void walkFileTreeOurWay(Path path, FileVisitor<? super Path> visitor) th
BasicFileAttributes attrs = Files.readAttributes(p, BasicFileAttributes.class);
visitor.visitFile(p, attrs);
} catch (IOException e) {
throw Exceptions.handle(e);
throw Exceptions.handle(Storage.LOG, e);
}
});
}
Expand Down Expand Up @@ -342,7 +342,7 @@ public List<StoredObject> getObjects(@Nullable String query, Limit limit) {
.map(StoredObject::new)
.toList();
} catch (IOException e) {
throw Exceptions.handle(e);
throw Exceptions.handle(Storage.LOG, e);
}
}

Expand All @@ -358,7 +358,7 @@ public int countObjects(@Nullable String query) {
.filter(currentFile -> isMatchingObject(query, currentFile))
.count());
} catch (IOException e) {
throw Exceptions.handle(e);
throw Exceptions.handle(Storage.LOG, e);
}
}

Expand Down

0 comments on commit 53630bb

Please sign in to comment.