rascal
rascal copied to clipboard
IO exceptions sometimes have a null message, we should detect that and throw something else.
Sometimes you get a print like:
readBinaryValueFile: ... throws null
exception... throws: IO("")
stacktrace
Which is caused by this pattern in Prelude.java:
catch (IOException e) {
System.err.println("readBinaryValueFile: " + loc + " throws " + e.getMessage());
throw RuntimeExceptionFactory.io(values.string(e.getMessage()));
}
It's not just readBinaryValueFile, but all those exception translators. The getMessage can return null, so we should in that case think of something better to print, like the class name? or use the toString() of the exception?