Example #1
0
def CheckStatus(scope_service, vi, result):
    if (result.status != 0):
        error_result = scope_service.GetErrorMessage(
            niscope_types.GetErrorMessageRequest(vi=vi,
                                                 error_code=result.status))
        print(error_result.error_message)
        exit()
def ThrowOnError (vi, error_code):
    error_message_request = niscope_types.GetErrorMessageRequest(
        vi = vi,
        error_code = error_code
        )
    error_message_response = niscope_client.GetErrorMessage(error_message_request)
    raise Exception (error_message_response.error_message)
Example #3
0
def ThrowOnError(service, vi, error_code):
    if service == scope_service:
        error_message_request = niscope_types.GetErrorMessageRequest(
            vi=vi, error_code=error_code)
        error_message_response = scope_service.GetErrorMessage(
            error_message_request)
        raise Exception(error_message_response.error_message)
    else:
        error_message_request = nitclk_types.GetExtendedErrorInfoRequest()
        error_message_response = tclk_service.GetExtendedErrorInfo(
            error_message_request)
        raise Exception(error_message_response.error_string)