def add_bgp_error_metadata(code, sub_code, def_desc='unknown'):
    # Check registry if we already have an exception with same code/sub-code
    if _EXCEPTION_REGISTRY.get((code, sub_code)) is not None:
        raise ValueError('BGPSException with code %d and sub-code %d '
                         'already defined.' % (code, sub_code))

    def decorator(klass):
        """Sets class constants for exception code and sub-code.

        If given class is sub-class of BGPSException we sets class constants.
        """
        if issubclass(klass, BGPSException):
            _EXCEPTION_REGISTRY[(code, sub_code)] = klass
            klass.CODE = code
            klass.SUB_CODE = sub_code
            klass.DEF_DESC = def_desc
        return klass
    return decorator
Returns the target output for this task.
dataset/ETHPy150Open osrg/ryu/ryu/services/protocols/bgp/base.py/add_bgp_error_metadata--crossover with--dataset/ETHPy150Open spotify/luigi/examples/terasort.py/TeraGen.output