...
Diese Unterscheidung ist in "Opus Fehlermeldungen" dokumentiert.
Exception Objekt:
Name | Typ | Beschreibung |
---|
OpusError | integer | Fehlercode von Opus |
ErrorText | string | Text der Opus Fehlermeldung |
ErrorCode | integer | Erweiterter Fehlercode oder 0, falls nicht verfügbar |
Location | string | Programmteil der Exception |
SourceCode | string | Programmzeile auf welcher die Exception aufgetreten ist |
LineNumber | integer | Zeilennummer der Exception |
AdditionalInformation | string | Zusatzinformationen, falls vorhanden |
DateTime | datetime | Zeitstempel |
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 } /* |
---|
cahtchcatch */
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.
|
---|