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).


fname = "log.txt"
errfs = oechem.oeofstream(fname)

if not errfs:
    oechem.OEThrow.Fatal("Unable to create %s" % fname)
oechem.OEThrow.Warning("Sending warning to 'log.txt' file")