File: error_handling.rst

package info (click to toggle)
ecflow 5.15.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 51,868 kB
  • sloc: cpp: 269,341; python: 22,756; sh: 3,609; perl: 770; xml: 333; f90: 204; ansic: 141; makefile: 70
file content (15 lines) | stat: -rw-r--r-- 413 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
.. _error_handling:

Error Handling
////////////////

Any errors in the creation of suite are handled by throwing an exception.

.. code-block:: python

  try:
      defs = ecflow.Defs()  # create a empty definition
      s1 = defs.add_suite("s1")  # create a suite "s1" and add to defs
      s2 = defs.add_suite("s1")  # Exception thrown trying to add suite "s1" again
  except RuntimeError as e:
      print(e)