Li Jiang 42b27b9a9d
Add isort (#2265)
* Add isort

* Apply isort on py files

* Fix circular import

* Fix format for notebooks

* Fix format

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-04-05 02:26:06 +00:00

12 lines
390 B
Python

from autogencap.DebugLog import Error
from autogencap.proto.CAP_pb2 import Error as ErrorMsg
from autogencap.proto.CAP_pb2 import ErrorCode
def report_error_msg(msg: ErrorMsg, src: str):
if msg is not None:
err = ErrorMsg()
err.ParseFromString(msg)
if err.code != ErrorCode.EC_OK:
Error(src, f"Error response: code[{err.code}] msg[{err.message}]")