Skip to content

Cleaner Error messages #849

@uramirez8707

Description

@uramirez8707

Is your feature request related to a problem? Please describe.
The error messages are very verbose. For example,

clone of FMSpid exited with status 128                    
There was an error with the checkout script /ncrc/home2/Eric.Stofferahn/fremake_2025/c6/sm4.5_compile_test03232026/src/checkout.sh             Traceback (most recent call last):
  File "/ncrc/home2/fms/local/opt/fre/2026.01.alpha1/bin/fre", line 8, in <module>
    sys.exit(fre())
             ~~~^^
  File "/ncrc/home2/fms/.conda/envs/fre-2026.01.alpha1/lib/python3.14/site-packages/click/core.py", line 1485, in __call__
    return self.main(*args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/ncrc/home2/fms/.conda/envs/fre-2026.01.alpha1/lib/python3.14/site-packages/click/core.py", line 1406, in main
    rv = self.invoke(ctx)
  File "/ncrc/home2/fms/.conda/envs/fre-2026.01.alpha1/lib/python3.14/site-packages/click/core.py", line 1873, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/ncrc/home2/fms/.conda/envs/fre-2026.01.alpha1/lib/python3.14/site-packages/click/core.py", line 1873, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/ncrc/home2/fms/.conda/envs/fre-2026.01.alpha1/lib/python3.14/site-packages/click/core.py", line 1269, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ncrc/home2/fms/.conda/envs/fre-2026.01.alpha1/lib/python3.14/site-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
  File "/ncrc/home2/fms/.conda/envs/fre-2026.01.alpha1/lib/python3.14/site-packages/fre/make/fremake.py", line 162, in checkout_script
    create_checkout_script.checkout_create(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        yamlfile, platform, target, no_parallel_checkout, gitjobs, execute, force_checkout)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ncrc/home2/fms/.conda/envs/fre-2026.01.alpha1/lib/python3.14/site-packages/fre/make/create_checkout_script.py", line 130, in checkout_
create
    baremetal_checkout_write(model_yaml, src_dir, jobs, pc, execute)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ncrc/home2/fms/.conda/envs/fre-2026.01.alpha1/lib/python3.14/site-packages/fre/make/create_checkout_script.py", line 30, in baremetal_
checkout_write
    fre_checkout.run()
    ~~~~~~~~~~~~~~~~^^
  File "/ncrc/home2/fms/.conda/envs/fre-2026.01.alpha1/lib/python3.14/site-packages/fre/make/gfdlfremake/checkout.py", line 128, in run
    subprocess.run(args=[self.src+"/"+self.fname], check=True)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ncrc/home2/fms/.conda/envs/fre-2026.01.alpha1/lib/python3.14/subprocess.py", line 577, in run
    raise CalledProcessError(retcode, process.args,
                             output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/ncrc/hoAllow users to see the full traceback only if a --debug or -v flag is passed.me2/Eric.Stofferahn/fremake_2025/c6/sm4.5_compile_test03232026/src/checkout.sh']' returned no
n-zero exit status 128.

This is a problem because users will need to parse through all the output to figure out what the actual problem is. In the example above, the helpful messages are buried at the very top and bottom:

clone of FMSpid exited with status 128
subprocess.CalledProcessError: Command '['/ncrc/home2/Eric.Stofferahn/fremake_2025/c6/sm4.5_compile_test03232026/src/checkout.sh']' returned no
n-zero exit status 128.

Describe the solution you'd like
I think with errors like this we should not print out the stack trace and just the actual errors.

Because the traceback can be helpful in some cases, I suggest adding a --verbose flag for devs.

Describe alternatives you've considered
Leave as is

Additional context
N/A

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions