-
Notifications
You must be signed in to change notification settings - Fork 1
/
exceptions.py
40 lines (29 loc) · 976 Bytes
/
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
# Copyright 2024 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
class ImproperlyConfigured(Exception):
"""Required setting is missing"""
pass
class DataFailureException(Exception):
"""
This exception means there was an error fetching content
in one of the rest clients. You can get the url that failed
with .url, the status of the error with .status, and any
message with .msg
"""
def __init__(self, url, status, msg):
self.url = url
self.status = status
self.msg = msg
def __str__(self):
return (
"Error fetching {}. Status code: {}. Message: {}.".format(
self.url, self.status, self.msg))
class InvalidRegID(Exception):
"""Exception for invalid regid."""
pass
class InvalidNetID(Exception):
"""Exception for invalid netid."""
pass
class InvalidEmployeeID(Exception):
"""Exception for invalid employee id."""
pass