restructure the tolerance error's logic of client