def request_error_header(exception):
    """
    Generates the error header for a request using a Bearer token based on a given OAuth exception.
    """

    from .conf import options
    
    header = "Bearer realm=\"%s\"" % (options.realm, )
    
    if hasattr(exception, "error"):
        header = header + ", error=\"%s\"" % (exception.error, )
    
    if hasattr(exception, "reason"):
        header = header + (exception.reason, ) % ", error_description=\"%s\""
    
    return header
dataset/ETHPy150Open Rediker-Software/doac/doac/utils.py/request_error_header/swapped operands of `%`