File tree Expand file tree Collapse file tree
yamcs-client/src/yamcs/client/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919from google .protobuf import timestamp_pb2
2020from yamcs .client .core .auth import APIKeyCredentials , Credentials
2121from yamcs .client .core .context import Context
22+ from yamcs .client .core .exceptions import YamcsError
2223from yamcs .client .core .futures import WebSocketSubscriptionFuture
2324from yamcs .client .core .helpers import (
2425 delimit_protobuf ,
@@ -273,9 +274,12 @@ def get_auth_info(self) -> AuthInfo:
273274 self .ctx .auth_root , # Full URL, so don't use get_proto
274275 headers = {"Accept" : "application/protobuf" },
275276 )
276- message = auth_pb2 .AuthInfo ()
277- message .ParseFromString (response .content )
278- return AuthInfo (message )
277+ if 200 <= response .status_code < 300 :
278+ message = auth_pb2 .AuthInfo ()
279+ message .ParseFromString (response .content )
280+ return AuthInfo (message )
281+ else :
282+ raise YamcsError (f"{ response .status_code } Server Error" )
279283
280284 def get_user_info (self ) -> UserInfo :
281285 """
You can’t perform that action at this time.
0 commit comments