import sys try: # provoziert Division durch 0 --> ArithmeticError a = 1/0 print(a) except ArithmeticError as err: # Ausgabe der Exception print("Fehler:", err) # detailliertere Infos print("Detail:", sys.exc_info()) else: # optional: wird nur erreicht, wenn keine Exception print("Alles ok.") finally: # optional: wird in jedem Fall erreicht print("Aufräumen.") # hier wieder regulärer Programmablauf print("Normal weiter.")
Kategorien
-
Neueste Beiträge
- [ABAP] Verschieben von Nodes per Drag & Drop innerhalb einer Baumansicht (CL_COLUMN_TREE_MODEL)
- [SAP] Screen Personas
- Weltall / Raumfahrt
- [CDS-Views] Virtuelle Elemente: Aufruf von ABAP-Coding aus CDS-Views heraus
- [CDS-Views] CDS: Verwendung von Operanden und Expressions
- Steuer
- [ABAP] Beliebiges PDF aus SAP heraus drucken
- [ABAP] Versand von Emails auf Basis von CDS-Views
- Volkswirtschaft
- [SAP] Entwicklung SAP ABAP Programming Model