-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathtableau_exceptions.py
executable file
·49 lines (35 loc) · 1.52 KB
/
tableau_exceptions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# -*- coding: utf-8 -*-
class TableauException(Exception):
def __str__(self):
return "{} Exception: {}".format(self.__class__.__name__,self.msg)
class NoMatchFoundException(TableauException):
def __init__(self, msg):
self.msg = msg
class AlreadyExistsException(TableauException):
def __init__(self, msg, existing_luid):
self.msg = msg
self.existing_luid = existing_luid
# Raised when an action is attempted that requires being signed into that site
class NotSignedInException(TableauException):
def __init__(self, msg):
self.msg = msg
# Raise when something an option is passed that is not valid in the REST API (site_role, permissions name, etc)
class InvalidOptionException(TableauException):
def __init__(self, msg):
self.msg = msg
class RecoverableHTTPException(TableauException):
def __init__(self, http_code, tableau_error_code, luid):
self.http_code = http_code
self.tableau_error_code = tableau_error_code
self.luid = luid
class PossibleInvalidPublishException(TableauException):
def __init__(self, http_code, tableau_error_code, msg):
self.http_code = http_code
self.tableau_error_code = tableau_error_code
self.msg = msg
class MultipleMatchesFoundException(TableauException):
def __init__(self, count):
self.msg = 'Found {} matches for the request, something has the same name'.format(str(count))
class NoResultsException(TableauException):
def __init__(self, msg):
self.msg = msg