AutoRpa/rpa_oms/app/inbound/repo.py

24 lines
766 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 收件仓库契约。
#
# DuplicateOmsId / DuplicateFid:幂等键已存在时的旧异常类型,班次和出站仍可能引用。
# RepoUnavailable 与 rpa_oracle.errors 是同一个类:连不上库或未配置,整包 HTTP 503。
from rpa_oracle.errors import RepoUnavailable
# 表 1 已有同一 oms_id。新入站路径用查重集合,不再抛这个。
class DuplicateOmsId(Exception):
# 记下冲突的 oms_id。
def __init__(self, oms_id: int):
self.oms_id = oms_id
# 表 3 已有同一 fid。新入站路径用查重集合,不再抛这个。
class DuplicateFid(Exception):
# 记下冲突的 fid。
def __init__(self, fid: int):
self.fid = fid
__all__ = ["DuplicateFid", "DuplicateOmsId", "RepoUnavailable"]