<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_message(self, bus, message):
 # pylint: disable=unused-argument """When a message is received from Gstreamer."""

        if message.type == Gst.MessageType.EOS:
            self.stop()
        elif message.type == Gst.MessageType.ERROR:
            self.stop()
            err, _ = message.parse_error()
            _LOGGER.error('%s', err)