Throw expected exception even-though a custom error handler is specified

Using `file_exists` with a local stream and a custom error handler specified will throw the exception specified by the custom error handler and therefore won't be catched.