Better exception handling when getting user by id