File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
yamcs-client/src/yamcs/client/core Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1717)
1818
1919from google .protobuf import timestamp_pb2
20+ from google .protobuf .message import DecodeError
2021from yamcs .client .core .auth import APIKeyCredentials , Credentials
2122from yamcs .client .core .context import Context
2223from yamcs .client .core .exceptions import YamcsError
@@ -275,9 +276,14 @@ def get_auth_info(self) -> AuthInfo:
275276 headers = {"Accept" : "application/protobuf" },
276277 )
277278 if 200 <= response .status_code < 300 :
278- message = auth_pb2 .AuthInfo ()
279- message .ParseFromString (response .content )
280- return AuthInfo (message )
279+ try :
280+ message = auth_pb2 .AuthInfo ()
281+ message .ParseFromString (response .content )
282+ return AuthInfo (message )
283+ except DecodeError :
284+ raise YamcsError (
285+ f"Unexpected response. Verify Yamcs URL: { self .ctx .url } "
286+ )
281287 else :
282288 raise YamcsError (f"{ response .status_code } Server Error" )
283289
You can’t perform that action at this time.
0 commit comments