-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexceptions.py
More file actions
26 lines (23 loc) · 1.19 KB
/
exceptions.py
File metadata and controls
26 lines (23 loc) · 1.19 KB
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
class VSAError(Exception):
"""Generic error returned from VSA"""
def __init__(self, *args):
import inspect
print("------------------ Begin VSAError ------------------")
print(f"A generic error occurred in {inspect.stack()[1].function}.")
print("If more details are available they will be printed below:")
if args:
print(f"{args[0]}")
print("------------------ End VSAError ------------------")
class ItemNotFound(VSAError):
"""We were unable to find the requested ticket or status."""
def __init__(self, RequestObject):
print("------------------ Begin ItemNotFound ------------------")
print("An ID/Reference in the request was not found in Kaseya.")
print(f"We tried to contact this url: {RequestObject.url}")
print(f"Raw response from Kaseya:\n {RequestObject.text}")
print("------------------ End ItemNotFound ------------------")
class AuthError(Exception):
"""The authentication with VSA is broken."""
def __init__(self, *args):
print("Got error 403 forbidden. The authentication either broke or you aren't authorized to perform the action you are attempting.")
exit()