@@ -822,6 +822,60 @@ class VersionUpgradePolicy(Enum):
822822 AS_IS : int
823823 UPGRADE_TO_V2 : int
824824
825+ class ErrorCode (Enum ):
826+ """
827+ An error code from the live subscription gateway.
828+
829+ AUTH_FAILED
830+ The authentication step failed.
831+ API_KEY_DEACTIVATED
832+ The user account or API key were deactivated.
833+ CONNECTION_LIMIT_EXCEEDED
834+ The user has exceeded their open connection limit
835+ SYMBOL_RESOLUTION_FAILED
836+ One or more symbols failed to resolve.
837+ INVALID_SUBSCRIPTION
838+ There was an issue with a subscription request (other than symbol resolution).
839+ INTERNAL_ERROR
840+ An error occurred in the gateway.
841+
842+ """
843+
844+ AUTH_FAILED : int
845+ API_KEY_DEACTIVATED : int
846+ CONNECTION_LIMIT_EXCEEDED : int
847+ SYMBOL_RESOLUTION_FAILED : int
848+ INVALID_SUBSCRIPTION : int
849+ INTERNAL_ERROR : int
850+
851+ @classmethod
852+ def variants (cls ) -> Iterable [ErrorCode ]: ...
853+
854+ class SystemCode (Enum ):
855+ """
856+ A `SystemMsg` code indicating the type of message from the live subscription
857+ gateway.
858+
859+ HEARTBEAT
860+ A message sent in the absence of other records to indicate the connection
861+ remains open.
862+ SUBSCRIPTION_ACK
863+ An acknowledgement of a subscription request.
864+ SLOW_READER_WARNING
865+ The gateway has detected this session is falling behind real-time.
866+ REPLAY_COMPLETED
867+ Indicates a replay subscription has caught up with real-time data.
868+
869+ """
870+
871+ HEARTBEAT : int
872+ SUBSCRIPTION_ACK : int
873+ SLOW_READER_WARNING : int
874+ REPLAY_COMPLETED : int
875+
876+ @classmethod
877+ def variants (cls ) -> Iterable [ErrorCode ]: ...
878+
825879class Metadata (SupportsBytes ):
826880 """
827881 Information about the data contained in a DBN file or stream. DBN requires
@@ -5937,6 +5991,19 @@ class ErrorMsg(ErrorMsgV1):
59375991 An error message from the Databento Live Subscription Gateway (LSG).
59385992 """
59395993
5994+ def __init__ (
5995+ self , ts_event : int , err : str , is_last : bool = True , code : ErrorCode | None = None
5996+ ) -> None : ...
5997+ @property
5998+ def code (self ) -> ErrorCode | None :
5999+ """
6000+ The error code, if any.
6001+
6002+ Returns
6003+ -------
6004+ ErrorCode | None
6005+ """
6006+
59406007 @property
59416008 def is_last (self ) -> int :
59426009 """
@@ -6087,14 +6154,15 @@ class SystemMsg(SystemMsgV1):
60876154
60886155 """
60896156
6157+ def __init__ (self , ts_event : int , msg : str , code : SystemCode | None = None ) -> None : ...
60906158 @property
6091- def code (self ) -> int :
6159+ def code (self ) -> SystemCode | None :
60926160 """
6093- Type of system message, currently unused .
6161+ Type of system message, if any .
60946162
60956163 Returns
60966164 -------
6097- int
6165+ SystemCode | None
60986166 """
60996167
61006168class SystemMsgV1 (Record ):
0 commit comments