<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, message):
 """Message from the backend has been received. :param message: Message string received. """

        work_unit = SelenolMessage(message)
        request_id = work_unit.request_id

        if message['reason'] == ['selenol', 'request']:
            try:
                result = self.on_request(work_unit)
                if result is not None:
                    return {
                        'reason': ['request', 'result'],
                        'request_id': request_id,
                        'content': {
                            'content': result,
                        },
                    }
            except SelenolException as e:
                logging.exception(e)
                return {
                    'reason': ['request', 'exception'],
                    'request_id': request_id,
                    'content': {
                        'message': str(e),
                    },
                }
            except Exception as e:
                logging.exception(e)
                return {
                    'reason': ['request', 'exception'],
                    'request_id': request_id,
                    'content': {
                        'message': 'Not a Selenol exception',
                    },
                }