-
Notifications
You must be signed in to change notification settings - Fork 0
Exception handling
Francesco Palozzi edited this page Jun 6, 2026
·
1 revision
| Exception | Checked? | When it is thrown |
|---|---|---|
IOException |
✅ | I/O error while reading or writing files |
IllegalArgumentException |
❌ | A file with a different format from the already-loaded ones is loaded |
RNAInputFileParserException |
❌ (unchecked) | File content does not conform to the expected syntax, or a weak bond has invalid indices |
try {
RNAFile file = io.loadFile(Path.of("structure.bpseq"));
RNAFile translated = translator.translate(file, RNAFormat.DB);
io.saveFiles(List.of(translated), Path.of("/output/"), false, false, "");
} catch (IOException e) {
System.err.println("I/O error: " + e.getMessage());
} catch (IllegalArgumentException e) {
System.err.println("Incompatible format: " + e.getMessage());
} catch (RNAInputFileParserException e) {
System.err.println("Parsing error: " + e.getMessage());
}Thrown when a file whose format differs from the session's recognized format is loaded. Fix by calling io.clearAllDataStructures() before loading files of a different format.
Thrown when:
- The file content does not match any recognized format grammar.
- A bond references an index outside the valid range (1 to sequence length). Check the file content and ensure it conforms to one of the supported formats.
Standard Java I/O exceptions — file not found, permission denied, disk full, etc.
RNA2DFormatIO – Copyright © 2026 Francesco Palozzi.
University of Camerino – Licensed under the Apache License, Version 2.0.