-
-
Notifications
You must be signed in to change notification settings - Fork 136
Expand file tree
/
Copy pathexceptions.py
More file actions
36 lines (24 loc) · 702 Bytes
/
exceptions.py
File metadata and controls
36 lines (24 loc) · 702 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
from dataclasses import dataclass
from openapi_core.exceptions import OpenAPIError
class PathError(OpenAPIError):
"""Path error"""
@dataclass
class PathNotFound(PathError):
"""Find path error"""
url: str
def __str__(self):
return "Path not found for {0}".format(self.url)
@dataclass
class OperationNotFound(PathError):
"""Find path operation error"""
url: str
method: str
def __str__(self):
return "Operation {0} not found for {1}".format(
self.method, self.url)
@dataclass
class ServerNotFound(PathError):
"""Find server error"""
url: str
def __str__(self):
return "Server not found for {0}".format(self.url)