pymech icon indicating copy to clipboard operation
pymech copied to clipboard

Explicit errors and fail quickly

Open ashwinvis opened this issue 4 years ago • 0 comments

This is not a good pattern to have. @guillaumechauvat had mentioned this before.

logger.error(...)
return 1

Rather than use C / Fortran style integer return, we should raise an error to avoid confusing error messages. This however might break some compatibility in user code, because someone might be not catching the errors as they should.

We can also have a PymechError custom exception if it helps.

ashwinvis avatar Oct 16 '21 08:10 ashwinvis