Example #1
0
def globusapi_hook(exception):
    write_error_info('GLobus API Error', [
        PrintableErrorField('HTTP status', exception.http_status),
        PrintableErrorField('code', exception.code),
        PrintableErrorField('message', exception.message, multiline=True)
    ])
    exit_with_mapped_status(exception.http_status)
Example #2
0
def transferapi_hook(exception):
    write_error_info('Transfer API Error', [
        PrintableErrorField('HTTP status', exception.http_status),
        PrintableErrorField('request_id', exception.request_id),
        PrintableErrorField('code', exception.code),
        PrintableErrorField('message', exception.message, multiline=True)
    ])
    exit_with_mapped_status(exception.http_status)
Example #3
0
def globus_generic_hook(exception):
    write_error_info(
        "Globus Error",
        [
            PrintableErrorField("error_type", exception.__class__.__name__),
            PrintableErrorField("message", str(exception), multiline=True),
        ],
    )
    sys.exit(1)
Example #4
0
def globus_generic_hook(exception):
    write_error_info(
        "Globus Error",
        [
            PrintableErrorField("error_type", exception.__class__.__name__),
            PrintableErrorField("message", str(exception), multiline=True),
        ],
    )
    sys.exit(1)
Example #5
0
def authentication_hook(exception):
    write_error_info(
        "No Authentication Error",
        [PrintableErrorField("HTTP status", exception.http_status),
         PrintableErrorField("code", exception.code),
         PrintableErrorField("message", exception.message, multiline=True)],
        message=("Globus CLI Error: No Authentication provided. Make sure "
                 "you have logged in with 'globus login'."))
    exit_with_mapped_status(exception.http_status)
Example #6
0
def invalidrefresh_hook(exception):
    write_error_info(
        "Invalid Refresh Token",
        [PrintableErrorField("HTTP status", exception.http_status),
         PrintableErrorField("code", exception.code),
         PrintableErrorField("message", exception.message, multiline=True)],
        message=("Globus CLI Error: Your credentials are no longer "
                 "valid. Please log in again with 'globus login'."))
    exit_with_mapped_status(exception.http_status)
Example #7
0
def globusapi_hook(exception):
    write_error_info(
        "GLobus API Error",
        [
            PrintableErrorField("HTTP status", exception.http_status),
            PrintableErrorField("code", exception.code),
            PrintableErrorField("message", exception.message, multiline=True),
        ],
    )
    exit_with_mapped_status(exception.http_status)
Example #8
0
def globusapi_hook(exception):
    write_error_info(
        "GLobus API Error",
        [
            PrintableErrorField("HTTP status", exception.http_status),
            PrintableErrorField("code", exception.code),
            PrintableErrorField("message", exception.message, multiline=True),
        ],
    )
    exit_with_mapped_status(exception.http_status)
Example #9
0
def transferapi_hook(exception):
    write_error_info(
        "Transfer API Error",
        [
            PrintableErrorField("HTTP status", exception.http_status),
            PrintableErrorField("request_id", exception.request_id),
            PrintableErrorField("code", exception.code),
            PrintableErrorField("message", exception.message, multiline=True),
        ],
    )
    exit_with_mapped_status(exception.http_status)
Example #10
0
def transferapi_hook(exception):
    write_error_info(
        "Transfer API Error",
        [
            PrintableErrorField("HTTP status", exception.http_status),
            PrintableErrorField("request_id", exception.request_id),
            PrintableErrorField("code", exception.code),
            PrintableErrorField("message", exception.message, multiline=True),
        ],
    )
    exit_with_mapped_status(exception.http_status)
Example #11
0
def invalidrefresh_hook(exception):
    write_error_info(
        "Invalid Refresh Token",
        [
            PrintableErrorField("HTTP status", exception.http_status),
            PrintableErrorField("code", exception.code),
            PrintableErrorField("message", exception.message, multiline=True),
        ],
        message=(
            "Globus CLI Error: Your credentials are no longer "
            "valid. Please log in again with 'globus login'."
        ),
    )
    exit_with_mapped_status(exception.http_status)
Example #12
0
def authentication_hook(exception):
    write_error_info(
        "No Authentication Error",
        [
            PrintableErrorField("HTTP status", exception.http_status),
            PrintableErrorField("code", exception.code),
            PrintableErrorField("message", exception.message, multiline=True),
        ],
        message=(
            "Globus CLI Error: No Authentication provided. Make sure "
            "you have logged in with 'globus login'."
        ),
    )
    exit_with_mapped_status(exception.http_status)
Example #13
0
def globus_generic_hook(exception):
    write_error_info('Globus Error', [
        PrintableErrorField('error_type', exception.__class__.__name__),
        PrintableErrorField('message', str(exception), multiline=True)
    ])
    sys.exit(1)