Debian Codegraph @

azure-kusto-ingest/azure/kusto/ingest/exceptions.py

raw
1 # Copyright (c) Microsoft Corporation.
2 # Licensed under the MIT License
3 from azure.kusto.data.exceptions import KustoClientError
4
5
6 class KustoMappingError(KustoClientError):
7 """
8 Raised when the provided mapping arguments are invalid.
9 """
10
11
12 class KustoDuplicateMappingError(KustoClientError):
13 """
14 Raised when ingestion properties include both
15 column mappings and a mapping reference
16 """
17
18 def __init__(self):
19 message = "Ingestion properties can't contain both an explicit mapping and a mapping reference."
20 super(KustoDuplicateMappingError, self).__init__(message)
21
22
23 class KustoMissingMappingError(KustoClientError):
24 """
25 Raised when provided a mapping kind without a mapping reference or column mapping.
26 """
27
28
29 class KustoInvalidEndpointError(KustoClientError):
30 """Raised when trying to ingest to invalid cluster type."""
31
32 def __init__(self, expected_service_type, actual_service_type, suggested_endpoint_url=None):
33 message = f"You are using '{expected_service_type}' client type, but the provided endpoint is of ServiceType '{actual_service_type}'. Initialize the client with the appropriate endpoint URI"
34 if suggested_endpoint_url:
35 message = message + ": '" + suggested_endpoint_url + "'"
36 super(KustoInvalidEndpointError, self).__init__(message)
37
38
39 class KustoQueueError(KustoClientError):
40
41 """Raised when not succeeding to upload message to queue in all retries"""
42
43 def __init__(self):
44 message = "Failed to upload message to queues in all reties."
45 super(KustoQueueError, self).__init__(message)