mirror of
https://github.com/correl/openapi-core.git
synced 2024-12-01 11:09:57 +00:00
36 lines
732 B
Python
36 lines
732 B
Python
import attr
|
|
|
|
from openapi_core.exceptions import OpenAPIError
|
|
|
|
|
|
class PathError(OpenAPIError):
|
|
"""Path error"""
|
|
|
|
|
|
@attr.s(hash=True)
|
|
class PathNotFound(PathError):
|
|
"""Find path error"""
|
|
url = attr.ib()
|
|
|
|
def __str__(self):
|
|
return "Path not found for {0}".format(self.url)
|
|
|
|
|
|
@attr.s(hash=True)
|
|
class OperationNotFound(PathError):
|
|
"""Find path operation error"""
|
|
url = attr.ib()
|
|
method = attr.ib()
|
|
|
|
def __str__(self):
|
|
return "Operation {0} not found for {1}".format(
|
|
self.method, self.url)
|
|
|
|
|
|
@attr.s(hash=True)
|
|
class ServerNotFound(PathError):
|
|
"""Find server error"""
|
|
url = attr.ib()
|
|
|
|
def __str__(self):
|
|
return "Server not found for {0}".format(self.url)
|