Doing this requires the code above to be aware that such an exception can be thrown on some platforms. In this state, someone writing code on FreeBSD would never encounter this exception, and then suddenly their code would fail on other platforms. I agree that some exception should be thrown, but if so then it should also be added to the method signature in order to avoid surprises.