rascal icon indicating copy to clipboard operation
rascal copied to clipboard

IO exceptions sometimes have a null message, we should detect that and throw something else.

Open DavyLandman opened this issue 1 year ago • 4 comments

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?

DavyLandman avatar Oct 22 '24 09:10 DavyLandman