add onError() function for update,save,remove.