Check subclass instead of error catching