Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepy
titlePython Error Handling
#For catching exceptions
except <Interface>Err.<ExceptionName>Ex as e:

#For raising exceptions
raise <Interface>ErrImpl.<ExceptionName>ExImpl().get<ExceptionName>Ex()

#For raising exceptions with parameters
err = <Interface>ErrImpl.<ExceptionName>ExImpl()
err.set<ParamName>(<Value>)
raise err.get<ExceptionName>Ex()

#For logging an error message from the exceptions
err = <Interface>ErrImpl.<ExceptionName>ExImpl()
err.log()
raise err.get<ExceptionName>Ex()

Data types mapping:

To check how data types are mapped between IDL and implementation click here.