-
Notifications
You must be signed in to change notification settings - Fork 0
Error handling
Francesco Palozzi edited this page Jun 5, 2026
·
1 revision
All parsing methods declare IOException and ParseException. The auto-detecting overloads additionally throw IllegalArgumentException when the format cannot be identified.
try {
String result = unifier.process(inputFile, true);
} catch (IOException e) {
// File could not be read
System.err.println("I/O error: " + e.getMessage());
} catch (java.text.ParseException e) {
// File was readable but content did not match the expected grammar
System.err.println("Parse error at offset " + e.getErrorOffset() + ": " + e.getMessage());
} catch (IllegalArgumentException e) {
// Auto-detection failed — the format was not recognised
System.err.println("Unknown format: " + e.getMessage());
}- The file is in a valid format for tool A but you passed
ToolType.B. - The file is truncated or corrupted.
- The tool version produced output with a minor format variation not covered by the grammar.
- The file is empty or too small (fewer than a few lines).
- The format is entirely custom or not one of the seven supported tools.
← Logging | Next: Running Tests →
RNA2DUnifier – Copyright © 2026 Francesco Palozzi.
University of Camerino – Licensed under the Apache License, Version 2.0.