-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathexceptions.py
More file actions
36 lines (24 loc) · 849 Bytes
/
exceptions.py
File metadata and controls
36 lines (24 loc) · 849 Bytes
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
"""
Deis API exception classes.
"""
from __future__ import unicode_literals
from rest_framework.exceptions import APIException
from rest_framework import status
class BuildNodeError(APIException):
"""
Indicates a problem in building or bootstrapping a node.
This exception is subclassed from rest_framework's APIException so it
isn't reported as "500 SERVER ERROR."
"""
status_code = status.HTTP_401_UNAUTHORIZED
def __init__(self, detail=None):
self.detail = detail
class BuildFormationError(APIException):
"""
Indicates a problem in creating a formation.
This exception is subclassed from rest_framework's APIException so it
isn't reported as "500 SERVER ERROR."
"""
status_code = status.HTTP_400_BAD_REQUEST
def __init__(self, detail=None):
self.detail = detail