Set the error message callback.

def error_msg_callback(self, callback):
        """Set the error message callback."""
        if callable(callback):
            self._error_msg_callback = callback
        else:
            self._error_msg_callback = None