This is the globally available error handler that is used to report all diagnostics generated by the OEChem, OESystem and OEPlatform libraries. The behavior of OEThrow may be customized via the various methods available to OEErrorHandler. For example, warning and error messages may be redirected to a file or string stream, instead of to OEPlatform.oeerr (the default).


String fname = "log.txt";
oeofstream errfs = new oeofstream();

if (!errfs.open(fname))
    oechem.OEThrow.Fatal("Unable to create %s" + fname);
oechem.OEThrow.Warning("Sending warning to 'log.txt' file");