Skip to content

Support preCICE Exception system #173

@BenjaminRodenberg

Description

@BenjaminRodenberg

In precice/precice#1594 we are currently introducing an exception system for preCICE. We should also support this in the python bindings.

Some necessary steps that I see here:

  • Cython has some support for C++ Exception, but we need to explicitly state that certain functions may throw an exception. For details see https://cython.readthedocs.io/en/latest/src/userguide/wrapping_CPlusPlus.html#exceptions.
  • Start with a single base exception precice.Error
  • Define our own exception system for more fine-grained errors (basically map thrown C++ preCICE exceptions to python exceptions). We should use larger python Frameworks as a template here (numpy, for example, also defines its own exceptions)
  • We should also make sure to be able to catch unknown exceptions (imagine C++ preCICE introduces a FooError upstream, then we want to at least raise a generic precice.Error here until we implement precice.FooError)
  • We should also add (some) tests for error handling. I think we can simply extend our mocked version of preCICE with some dummy exceptions and explicitly test for them to make sure that passing the error generally works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions