File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,8 @@ def DiracXClient() -> _DiracClient:
74
74
75
75
proxyLocation = getDefaultProxyLocation ()
76
76
diracxToken = diracxTokenFromPEM (proxyLocation )
77
+ if not diracxToken :
78
+ raise ValueError (f"No dirax token in the proxy file { proxyLocation } " )
77
79
78
80
with NamedTemporaryFile (mode = "wt" ) as token_file :
79
81
token_file .write (json .dumps (diracxToken ))
Original file line number Diff line number Diff line change 13
13
def main ():
14
14
Script .parseCommandLine ()
15
15
16
- with DiracXClient () as api :
17
- user_info = api .auth .userinfo ()
18
- print (json .dumps (user_info .as_dict (), indent = 2 ))
16
+ try :
17
+ with DiracXClient () as api :
18
+ user_info = api .auth .userinfo ()
19
+ print (json .dumps (user_info .as_dict (), indent = 2 ))
20
+ except Exception as e :
21
+ print (f"Failed to access DiracX: { e } " )
19
22
20
23
21
24
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments