Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error messages on GAMS errors #383

Closed
khaeru opened this issue Nov 18, 2020 · 0 comments · Fixed by #398
Closed

Improve error messages on GAMS errors #383

khaeru opened this issue Nov 18, 2020 · 0 comments · Fixed by #398
Labels
enh New features & functionality help welcome

Comments

@khaeru
Copy link
Member

khaeru commented Nov 18, 2020

When GAMS fails to execute (due to configuration errors, model coding errors, etc.), the traceback ends with, e.g.

>           raise CalledProcessError(retcode, cmd)
E           subprocess.CalledProcessError: Command 'gams "c:\users\username\documents\github\message_ix\message_ix\model\MESSAGE_run.gms"
--in="c:\users\username\documents\github\message_ix\message_ix\model\data\MsgData_message_data_test_message_data.gdx"
--out="c:\users\username\documents\github\message_ix\message_ix\model\output\MsgOutput_message_data_test_message_data.gdx"
--iter="c:\users\username\documents\github\message_ix\message_ix\model\output\MsgIterationReport_message_data_test_message_data.gdx" LogOption=4' returned non-zero exit status 3.
C:\ProgramData\Anaconda3\lib\subprocess.py:364: CalledProcessError

This can be cryptic, and isn't useful when reported in an issue. To improve, it should read something like:

ixmp.SolveError: The model failed to solve.

Further information may be available in the file:
c:\users\username\documents\github\message_ix\message_ix\model\MESSAGE_run.lst

The GAMS exit status could also be translated from this table.

This way, the user could (a) find and look at the listing file, or (b) attach it to a bug or issue report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enh New features & functionality help welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant