Action #3474
Explicit error message in GModelSpectralFunc constructor from xml for file attribute absent or empty file
Status: | New | Start date: | 12/02/2020 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assigned To: | - | % Done: | 0% | |
Category: | - | |||
Target version: | 2.0.0 | |||
Duration: |
Description
Currently when a GModelSpectralFunc is built from an XML file there is no explicit error message thrown by GModelSpectralFunc::read if there is no file attribute, or by GModelSpectralFunc::load_nodes if the file exists but it is empty. In both cases the model is initialised with empty energy node and value vectors. This results in errors when the model is used later, but the error message thrown then is not very easy to trace back to its root cause.
I think it could be useful to add error messages covering these two cases more transparent for the user.
Recurrence
No recurrence.