Alneos / vega

Finite element format converter
GNU General Public License v2.0
23 stars 9 forks source link

Error managment in VEGA #12

Open ThomasAbballe opened 8 years ago

ThomasAbballe commented 8 years ago

I am doing a bit of cleaning in the way VEGA handles error, especially in the Nastran reader. For now, some errors throw exceptions, others don't, and I don't know what is a warning and what is not. As a result, VEGA crashes way too often, sometimes for something minors.

Let's first talk about needs:

  1. I, and our clients, want VEGA to do its best. If it doesn't recognize a keyword, it should continue the work, and see what happens. If it's an unrecognized option, it should take the default value and issue a simple warning.
  2. As a debugger, I also need a way to stop at the first warning.
  3. As a developer, I know some functions must rigorously throw exceptions. Because exceptions and fatal errors are better than a stack overflow crash.

What we have now, in VEGA is:

  1. Point 1 is addressed by the the option --best-effort, even if it doesn't always work as intended.
  2. Same goes for point 2 and the --strict option.
  3. There is also a --mesh-only option. I don't know what criteria is used to switch to this mode.

The way I see things, we should have:

Strictness should be 0 (default, stop on critical errors), 1 (stop on both errors), 2 (stop on errors and warning)

Sorry for the long post. I am awaiting your opinions on this topic. Please forgive me if I only told obvious things, and correct me if I missed a point ;)

ThomasAbballe commented 8 years ago

I just added generic handlers to manage errors and warnings in Parsers and Writers. The actual politic on this topic is yet to be defined., but, whatever it will be, it should be easier to implement now.