Skip to content

Exception Type

Johannes Heucher edited this page Oct 12, 2022 · 3 revisions

An Exception Type is a special kind of Data Type that classifies errors of the same kind and is used for Error Handling purposes. It is used to define, what kind of exceptions might happen during processing a Service or to throw or catch such an exception. Apart from this, Exception Types can be used as Input or Output Parameters of Services.

There are four different types of Exception Types:

  • Xyna Exception Base: The Exception Type Xyna Exception Base (core.exception.XynaExceptionBase) is the direct or indirect Base Type of all other regularly modeled Exception Types. It is abstract, so it has to be extended by another Exception Type before the modeling user can use it to throw an exception. However, Xyna Exception Base can be used for catching all kinds of modeled Exception Types at once by defining a Catch with this type. This can be an advantage if an Error Handling doesn't neet to handle a specific exception.
  • Modeled Exception Type: A modeled Exception Type has the Base Type Xyna Exception Base or any other modeled Exception Type. So a modeled Exception Type always extends Xyna Exception Base.
  • Server Exception: The Exception Type Server Exception (core.exception.XynaException) is the Base Type of Xyna Exception Base. It is thrown by the Xyna Factory, mostly by Processing, if a known technical error has occurred.
  • Exception: The Exception Type Exception (core.exception.Exception) is the Base Type of Server Exception. It is thrown by any unknown error. This could be a problem inside the Xyna Factory, inside the modeled code of Coded Services or the interaction between Process Steps as consequence of null-valued Input Parameters.

Table of Contents

Create an Exception Type

As the graphical modeling is focused on subject-matter knowledge, it is also possible to create technical motivated Exception Types. These can be utilized within processes and Services in order to model and/or treat error conditions.

Modeling technical Exception Types, which can be thrown by Services, takes place analogously to modeling Data Types.

Create an Empty Exception Type

Open a new Exception Type via the New Document symbol in the left icon bar.

Change the Base Type

By default, Exception Types always extend the Exception Type core.exception.XynaExceptionBase.

Specify an Error Message

An error message can be specified for Exception Types, which is displayed as soon as they are thrown. The error message can be entered in any selectable language and is added by pressing the Set button.

Member Variables can be referenced in the error message using the notation %<number></number>%. The number specifies which Member Variable is to be used, beginning with 0.

To change an error message, select it and change the text inside of the text field. Afterwards the Set button has to be pushed.

Please note: The configuration of the DefaultLanguage variable in the file ${xynahome}/server/Exceptions.xml specifies, which language is displayed on error (changing the variable requires a server restart to take effect).

Remove an Error Message

If you want to remove an error message, remove the text inside of the text field with the respective language set and press the Set button.

Example

For an Exception Type having the Member Variables Subscriber ID and Reason, the error message "Active dunning for subscriber %0%, Reason: %1%" would replace the wildcards during runtime with the incoming Subscriber ID and the incoming Reason e.g. "Active dunning for subscriber 1234yKe, Reason: no response".

Move or Rename an Exception Type

See Move or Rename a Data Type

Remove an Exception Type

See Remove a Data Type

See Also

Clone this wiki locally