.. oe:namespace:: OEChem


.. oe:constnamespace:: OEWriteMolReturnCode

   The :oe:constns:`OEChem::OEWriteMolReturnCode` namespace encodes symbolic
   constants representing error codes returned by the high-level write
   functions :oe:func:`OEChem::OEWriteMolecule` and
   :oe:func:`OEChem::OEWriteConstMolecule`.

   This namespace contains the following constants:
   
   .. oe:constant:: Success

      This constant indicates that the molecule has been written out successfully.

   .. oe:constant:: FormatNotWritable

      This constant indicates that an unsupported output format for write was attempted.
      See :oe:func:`OEChem::OEIsWriteable`.

   .. oe:constant:: OEBWriteFailure

      This constant indicates a general error occurred when serializing the structure to :oe:const:`OEChem::OEFormat::OEB`.

   .. oe:constant:: TooManyAtoms

      This constant indicate that the molecule exceeds the limits for the specified format,
      for example: >99999 atoms for :oe:const:`OEChem::OEFormat::PDB`.

   .. oe:constant:: NoConformer

      This constant indicates that writing a multi-conformer molecule has
      failed due to a missing conformation.

   .. oe:constant:: InvalidSDData

      This constant indicates that invalid SD data is present on the structure which would
      result in a noncompliant output :oe:const:`OEChem::OEFormat::SDF` format.
      An attempt was made to alter the output data to ensure compliance with strict readers.

   .. oe:constant:: MolInvalidForFileFormatSpec 

      This constant indicates that a molecule cannot be written to the requested format, 
      because it would violate the format spec. As an example, not all molecules read from MMCIF can be
      written to the PDB file format. Examples issues are, multi-character chain IDs and residue names 
      exceeding the 3-character limit in PDB format.
