amusecode / amuse

Astrophysical Multipurpose Software Environment. This is the main repository for AMUSE
http://www.amusecode.org
Apache License 2.0
152 stars 98 forks source link

Crash when generating invalid parameter error message #1012

Open LourensVeen opened 7 months ago

LourensVeen commented 7 months ago

Describe the bug When trying to set a parameter on a code that does not have that parameter, AMUSE tries to generate a clear error message to raise, but crashes when doing so, resulting in a difficult-to-understand exception being raised instead.

To Reproduce Set a parameter on a code that does not have it.

Expected behavior An exception raised with clear error message along the lines of "code X does not have parameter Y".

Additional context Reported by @cconroy20 in https://github.com/amusecode/amuse/issues/1004. See my comments there on where the bug is. We still need to figure out if we can get the name of the code, and if so, how.