openapi-core/openapi_core/templating/paths/exceptions.py

37 lines
732 B
Python
Raw Normal View History

2020-02-21 16:33:45 +00:00
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)