<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def on_api_error(self, error_status=None, message=None, event_origin=None):
 """ API error handling """

        if message.meta["error"].find("Widget instance not found on server") > -1:
            # widget is missing on the other side, try to re-attach
            # then try again
            error_status["retry"] = True
            self.comm.attach_remote(
                self.id,
                self.remote_name,
                remote_name=self.name,
                **self.init_kwargs
            )