MWATelescope / mwalib

Library to read Murchison Widefield Array (MWA) raw visibilities, voltages and metadata into a common structure
Mozilla Public License 2.0
10 stars 2 forks source link

Provide mechanism for allowing caller to receive warnings from mwalib #2

Open gsleap opened 4 years ago

gsleap commented 4 years ago

For cases where there are no errors, but warnings, we need a way to provide these to the caller.

This could be done in a similar way to OpenSSL "The OpenSSL is a cross-platform shared library that had much the same problem to solve. Their method has the library record detailed error information in an internal error queue, which the application can request when an error return value is seen and then present to the user in whichever way is appropriate." ... "There is a function provided for the application to request the "next error". This removes the earliest error from the internal queue, and returns it to the application".

So as warnings are generated as we read and validate the MWA files, we push a warning to the queue.

The caller / client app can pop them off until queue is empty and do whatever with them (log, print to stdout/stderr).