@staticmethod
def handle_continue_exception(node, exception, message):
    """Handle exception raised in `_continue` call.

        If the process state of the node has not yet been put to excepted, the exception was raised before the process
        instance could be reconstructed, for example when the process class could not be loaded, thereby circumventing
        the exception handling of the state machine. Raising this exception will then acknowledge the process task with
        RabbitMQ leaving an uncleaned node in the `CREATED` state for ever. Therefore we have to perform the node
        cleaning manually.

        :param exception: the exception object
        :param message: string message to use for the log message
        """
    from aiida.engine import ProcessState
    if not node.is_excepted:
        node.logger.exception(message)
        node.set_exception(str(exception))
        node.set_process_state(ProcessState.EXCEPTED)
        node.seal()
