bbgo_origin/python/bbgo/data/error.py

19 lines
330 B
Python
Raw Permalink Normal View History

2022-04-13 06:52:34 +00:00
from __future__ import annotations
from dataclasses import dataclass
import bbgo_pb2
@dataclass
class ErrorMessage:
code: int
message: str
@classmethod
def from_pb(cls, obj: bbgo_pb2.Error) -> ErrorMessage:
return cls(
code=obj.error_code,
message=obj.error_message,
)