forked from doctormo/python-gitlab3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexceptions.py
More file actions
39 lines (30 loc) · 1.34 KB
/
exceptions.py
File metadata and controls
39 lines (30 loc) · 1.34 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
27
28
29
30
31
32
33
34
35
36
37
38
39
class GitLabException(Exception):
"""Base exception class"""
class MissingRequiredAttribute(GitLabException): # 400 Bad Request
"""A required attribute of the API request is missing,
e.g. the title of an issue is not given
"""
class UnauthorizedRequest(GitLabException): # 401 Unauthorized
"""The user is not authenticated, a valid user token is necessary"""
class ForbiddenRequest(GitLabException): # 403 Forbidden
"""The request is not allowed, e.g. the user is not
allowed to delete a project
"""
class ResourceNotFound(GitLabException): # 404 not Found
"""A resource could not be accessed, e.g. an ID for a
resource could not be found
"""
class RequestNotSupported(GitLabException): # 405 Method Not Allowed
"""The request is not supported"""
class ResourceConflict(GitLabException): # 409 Conflict
"""A conflicting resource already exists, e.g. creating a project
with a name that already exists
"""
class ServerError(GitLabException): # 500 Server Error
"""While handling the request something went wrong on the server side"""
class Unprocessable(GitLabException): # 422 Unprocessable
pass
class ConnectionError(GitLabException):
"""A connection to GitLab could not be established due to a
network problem, e.g. DNS failure, network is down, etc.
"""