File tree Expand file tree Collapse file tree 3 files changed +4
-22
lines changed Expand file tree Collapse file tree 3 files changed +4
-22
lines changed Original file line number Diff line number Diff line change 54
54
cmdstan_version_before ,
55
55
do_command ,
56
56
get_logger ,
57
- returncode_msg ,
58
57
)
59
58
from cmdstanpy .utils .filesystem import (
60
59
temp_inits ,
@@ -2162,14 +2161,13 @@ def _timer_target() -> None:
2162
2161
get_logger ().info ('%s done processing' , logger_prefix )
2163
2162
2164
2163
if retcode != 0 :
2165
- retcode_summary = returncode_msg (retcode )
2166
2164
serror = ''
2167
2165
try :
2168
2166
serror = os .strerror (retcode )
2169
2167
except (ArithmeticError , ValueError ):
2170
2168
pass
2171
2169
get_logger ().error (
2172
- ' %s error: %s %s' , logger_prefix , retcode_summary , serror
2170
+ " %s error: code '%d' %s" , logger_prefix , retcode , serror
2173
2171
)
2174
2172
2175
2173
@staticmethod
Original file line number Diff line number Diff line change 20
20
validate_dir ,
21
21
wrap_url_progress_hook ,
22
22
)
23
- from .command import do_command , returncode_msg
23
+ from .command import do_command
24
24
from .data_munging import build_xarray_data , flatten_chains
25
25
from .filesystem import (
26
26
SanitizedOrTmpFilePath ,
@@ -114,7 +114,6 @@ def show_versions(output: bool = True) -> str:
114
114
'parse_rdump_value' ,
115
115
'pushd' ,
116
116
'read_metric' ,
117
- 'returncode_msg' ,
118
117
'rload' ,
119
118
'set_cmdstan_path' ,
120
119
'set_make_env' ,
Original file line number Diff line number Diff line change @@ -71,25 +71,10 @@ def do_command(
71
71
serror = os .strerror (proc .returncode )
72
72
except (ArithmeticError , ValueError ):
73
73
pass
74
- msg = ' Command {}\n \t {} {}' .format (
75
- cmd , returncode_msg ( proc .returncode ) , serror
74
+ msg = " Command {}\n \t exited with code '{}' {}" .format (
75
+ cmd , proc .returncode , serror
76
76
)
77
77
raise RuntimeError (msg )
78
78
except OSError as e :
79
79
msg = 'Command: {}\n failed with error {}\n ' .format (cmd , str (e ))
80
80
raise RuntimeError (msg ) from e
81
-
82
-
83
- def returncode_msg (retcode : int ) -> str :
84
- """interpret retcode"""
85
- if retcode < 0 :
86
- sig = - 1 * retcode
87
- return f'terminated by signal { sig } '
88
- if retcode <= 125 :
89
- return 'error during processing'
90
- if retcode == 126 : # shouldn't happen
91
- return ''
92
- if retcode == 127 :
93
- return 'program not found'
94
- sig = retcode - 128
95
- return f'terminated by signal { sig } '
You can’t perform that action at this time.
0 commit comments