feature(patch) add error check