<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def error_received(self, exception):
 """Datagram error callback."""

        if exception is None:
            pass
        else:
            import pprint
            pprint.pprint(exception)
            _LOGGER.error('Error received: %s', exception)