code: def error_handler(self, handler):
          
          if not self.opened():
              handler = handler or util.noop
              self._error_handler = enums.JLinkFunctions.LOG_PROTOTYPE(handler)
              self._dll.JLINKARM_SetErrorOutHandler(self._error_handler)
docs: Setter for the error handler function.
  
          If the DLL is open, this function is a no-op, so it should be called
          prior to calling ``open()``.
  
          Args:
            self (JLink): the ``JLink`` instance
            handler (function): function to call on error messages
  
          Returns:
            ``None``