openapi-core/openapi_core/templating/paths/exceptions.py
2020-03-02 11:26:54 +00:00

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)