-
Notifications
You must be signed in to change notification settings - Fork 0
Error Handling
Groundbreaking edited this page Aug 29, 2025
·
1 revision
-
FileReadException- Runtime exception for all I/O errors -
IllegalStateException- Invalid operations (reset without mark)
try {
String content = Fission.readString("file.txt");
} catch (FileReadException e) {
logger.error("Failed to read file", e);
// Recovery logic
}
// For character sources
try (CharSource source = Fission.chars("file.txt")) {
// Processing
} // Auto-close even on exception- File not found →
FileReadException - Permission denied →
FileReadException - Invalid mark/reset →
IllegalStateException - Encoding issues →
FileReadException