Skip to content

Commit 85bec08

Browse files
matusvalosprytnyk
andcommitted
Added try-except-raise message example
Co-authored-by: Vladyslav Krylasov <vladyslav.krylasov@gmail.com>
1 parent 257dcd5 commit 85bec08

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
try:
2+
1 / 0
3+
except: # [try-except-raise]
4+
raise
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
try:
2+
1 / 0
3+
except ZeroDivisionError as e:
4+
raise ValueError from e

0 commit comments

Comments
 (0)