tokencrawler/.venv/lib/python3.9/site-packages/jsonrpcserver/exceptions.py
2022-03-17 22:16:30 +01:00

10 lines
408 B
Python

"""A JsonRpcError exception can be raised from inside a method, as an alternative way to
return an error response. See https://github.com/explodinglabs/jsonrpcserver/discussions/158
"""
from typing import Any
from .sentinels import NODATA
class JsonRpcError(Exception):
def __init__(self, code: int, message: str, data: Any = NODATA):
self.code, self.message, self.data = (code, message, data)