I create a library to parse object and executable files. When the given file is not exists, I throw the my.NoSuchFileException. I think it’s good, because the file is really not exists.
On JVM, since there’s a java.nio.file.NoSuchFileException, so I actual typealias NoSuchFileException = java.nio.file.NoSuchFileException. I think it’s great. The JVM user can keep their styles.
On the other platform, I actual it with my class, since there’s no standarized one.
But now, I found I make a mess. If many libraries do this like me. Also if I create more libraries in the same way. How many NoSuchFileException we expected to handling, on non-JVM platform?
I haven’t found a way to make the best of both worlds. What about you?
What do you think of add some well-known exceptions into the stdlib? After adding them, how to evoluation them? How to make them compatible with current platform implementation?