Versions Compared

Key

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

...

Diese Unterscheidung ist in "Opus Fehlermeldungen" dokumentiert.

Exception Objekt:

NameTypBeschreibung
OpusErrorintegerFehlercode von Opus
ErrorTextstringText der Opus Fehlermeldung
ErrorCodeintegerErweiterter Fehlercode oder 0, falls nicht verfügbar
LocationstringProgrammteil der Exception
SourceCodestringProgrammzeile auf welcher die Exception aufgetreten ist
LineNumberintegerZeilennummer der Exception
AdditionalInformationstringZusatzinformationen, falls vorhanden
DateTimedatetimeZeitstempel


Beispiel 1:

try
{
if (condition) throw;
} /* try */

catch (Lo_Ex) when (Lo_Ex.OpusError == 142) // handle exception only when a condition is true
{
  // Do something with exception object Lo_Ex
} /* catch */

catch // multiple catch allowed, Argument and 'when' are optional, catch without condition catches all
{ // if not caught by the previous catch

  if (condition) throw; // rethrow exception
} /*
cahtch
catch */

finally // 'finally' is optional
{
// This is always executed
} /* finally */


Beispiel 2:

// try, catch und finally können auch mit Einzelbefehlen verwendet werden

try Li_Value = Lo_WebServiceObject.s_Value; // Wird kein catch angegeben, wird eine Exception automatisch getilgt.