bbgo_origin/python/bbgo/data/error.py
2022-04-13 23:20:57 +08:00

19 lines
330 B
Python

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,
)