File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -2286,6 +2286,11 @@ def diagnose(
22862286 cmd , capture_output = True , check = False , text = True
22872287 )
22882288 if proc .returncode :
2289+ get_logger ().error (
2290+ "'diagnose' command failed!\n stdout:%s\n stderr:%s" ,
2291+ proc .stdout ,
2292+ proc .stderr ,
2293+ )
22892294 if require_gradients_ok :
22902295 raise RuntimeError (
22912296 "The difference between autodiff and finite difference "
@@ -2300,8 +2305,13 @@ def diagnose(
23002305 )
23012306
23022307 # Read the text and get the last chunk separated by a single # char.
2303- with open (output ) as handle :
2304- text = handle .read ()
2308+ try :
2309+ with open (output ) as handle :
2310+ text = handle .read ()
2311+ except FileNotFoundError as ex :
2312+ raise RuntimeError (
2313+ "Output of 'diagnose' command does not exist."
2314+ ) from ex
23052315 * _ , table = re .split (r"#\s*\n" , text )
23062316 table = (
23072317 re .sub (r"^#\s*" , "" , table , flags = re .M )
You can’t perform that action at this time.
0 commit comments