Is "inClass" not "User.class" in this case such that you can do a check instead of a try..catch?