Closed
Description
I'm currently looking at what dart2js reports when it cannot read a file and noticed a few things about FileIOException that I wish were different.
- I wish that I could extract the file name directly from the exception object.
- I wish the osError field had a less low-level feel to it.
Currently, this is how I deal with FileIOException:
...
} catch (FileIOException ex) {
print('Error reading ${relativize(cwd, uri)}: ${ex.osError}.');
exit(1);
}
This prints:
Error reading fiskefisk: OS Error: No such file or directory, errno = 2.
This message contains a lot of information that is nice for a developer, but to my user, I would like to simply print:
Error reading fiskefisk: No such file or directory.