-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patherrors.py
More file actions
52 lines (32 loc) · 864 Bytes
/
Copy patherrors.py
File metadata and controls
52 lines (32 loc) · 864 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from dataclasses import dataclass
class MLupError(Exception):
pass
class LoadError(MLupError):
pass
class ModelLoadError(LoadError):
pass
class WebAppLoadError(LoadError):
pass
class ModelBinarizationError(ModelLoadError):
pass
class PredictError(MLupError):
http_status: int = 500
type: str = 'predict_error'
@dataclass
class PredictWaitResultError(PredictError):
msg: str
predict_id: str
http_status: int = 408
type: str = 'predict_wait_result_error'
def __str__(self):
return self.msg
class PredictTransformDataError(PredictError):
type: str = 'predict_transform_data_error'
@dataclass
class PredictValidationInnerDataError(PredictError):
msg: str
predict_id: str
http_status: int = 422
type: str = 'validation_error'
def __str__(self):
return self.msg