pFlogger icon indicating copy to clipboard operation
pFlogger copied to clipboard

Add return codes to pflogger

Open tclune opened this issue 4 years ago • 2 comments

When a format is bad pflogger crashes with a minimally helpful message. Preferable would be to throw an exception, but since we do not have those in Fortran, we must use the Fortran convention of an optional return code.

The fix is straightforward, but rather tedious to propagate. It may also require analogous changes in gFTL, though RC's there should mostly be in place already.

tclune avatar Dec 07 '20 12:12 tclune

It seems pFlogger could not share the error handling with MAPL since it is in baselib and a level higher than MAPL.

weiyuan-jiang avatar Dec 07 '20 15:12 weiyuan-jiang

Not sure I understand. But taking a guess:

Each project needs to have its own error handling facility. But most of the GFE layers have a flexible facility that allows a higher-level project to specify how to handle errors. This is used for instance to allow unit tests to have a different behavior (continue running) than the regular program (stop). Tools like MAPL can set the behavior by passing in a procedure that will be used.

It is possible that pflogger does not already have this in place, but I suspect it does to facilitate the unit testing. Look to see if there is an "init" passed to the testing framework in the CMakeLists.txt under ./tests.

tclune avatar Dec 07 '20 15:12 tclune