Skip to content
This repository was archived by the owner on Jul 12, 2022. It is now read-only.

Commit a63fbd0

Browse files
committed
main: minor log-ex improvs.
1 parent 9b58ad6 commit a63fbd0

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

fuefit/main.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,20 +137,18 @@ def main(argv=None):
137137
log.info("Input Model: %s", json_dumps(mdl))
138138
mdl = validate_model(mdl)
139139

140-
141-
142140
except (SystemExit) as ex:
143141
if DEBUG:
144-
log.error(traceback.format_exception())
142+
log.exception('Invalid args!')
145143
raise
146144
except (ValueError) as ex:
147145
if DEBUG:
148-
log.error(traceback.format_exception())
146+
log.exception('Cmd-line parsing failed!')
149147
indent = len(program_name) * " "
150148
parser.exit(3, "%s: %s\n%s for help use --help\n"%(program_name, ex, indent))
151149
except jsons.ValidationError as ex:
152150
if DEBUG:
153-
log.error(traceback.format_exception())
151+
log.exception('Invalid input model!')
154152
indent = len(program_name) * " "
155153
parser.exit(4, "%s: Model validation failed due to: %s\n%s for help use --help\n"%(program_name, ex, indent))
156154

@@ -361,8 +359,8 @@ def build_args_parser(program_name, version, desc, epilog):
361359
* When more input-files given, the number --icolumns and --irenames options,
362360
must either match them, be 1 (meaning use them for all files), or be totally absent
363361
(meaning use defaults for all files). """),
364-
action='append', nargs='+',
365-
default=[('- file_frmt=%s model_path=%s'%('CSV', _default_df_dest)).split()],
362+
action='append', nargs='+', required=True,
363+
# default=[('- file_frmt=%s model_path=%s'%('CSV', _default_df_dest)).split()],
366364
metavar='ARG')
367365
grp_io.add_argument('-c', '--icolumns', help=dedent("""\
368366
describes the contents and the units of input file(s) (see --I).

0 commit comments

Comments
 (0)