fix: 'Error' implementation
This commit is contained in:
@@ -54,8 +54,10 @@ class Response[T]:
|
||||
def __str__(self):
|
||||
data = dict()
|
||||
data['id'] = self.id
|
||||
if isinstance(self.inner, Error): data['error'] = self.inner.response()
|
||||
else: data['result'] = self.inner
|
||||
if isinstance(self.inner, Error):
|
||||
data['error'] = self.inner.response()
|
||||
else:
|
||||
data['result'] = self.inner
|
||||
return json.dumps(data)
|
||||
|
||||
class Error(Enum):
|
||||
@@ -65,8 +67,8 @@ class Error(Enum):
|
||||
INVALID_PARAMS = -32602
|
||||
INTERNAL_ERROR = -32603
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
def __init__(self, *args):
|
||||
super().__init__(args)
|
||||
self.data = None
|
||||
|
||||
def message(self) -> str:
|
||||
|
||||
Reference in New Issue
Block a user