Skip to content

Commit 98da6a8

Browse files
committed
better errors
1 parent 9bbdf1b commit 98da6a8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/lol/hyper/anarchystats/WorldSize.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package lol.hyper.anarchystats;
22

3-
import java.io.File;
3+
import org.bukkit.Bukkit;
4+
45
import java.io.IOException;
56
import java.nio.file.*;
67
import java.nio.file.attribute.BasicFileAttributes;
@@ -37,7 +38,7 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
3738
@Override
3839
public FileVisitResult visitFileFailed(Path file, IOException exc) {
3940

40-
System.out.println("skipped: " + file + " (" + exc + ")");
41+
Bukkit.getLogger().warning("File " + file + " doesn't exist. (" + exc + ")");
4142
// Skip folders that can't be traversed
4243
return FileVisitResult.CONTINUE;
4344
}
@@ -46,7 +47,7 @@ public FileVisitResult visitFileFailed(Path file, IOException exc) {
4647
public FileVisitResult postVisitDirectory(Path dir, IOException exc) {
4748

4849
if (exc != null)
49-
System.out.println("had trouble traversing: " + dir + " (" + exc + ")");
50+
Bukkit.getLogger().warning("Had trouble traversing: " + dir + " (" + exc + ")");
5051
// Ignore errors traversing a folder
5152
return FileVisitResult.CONTINUE;
5253
}

0 commit comments

Comments
 (0)