mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 10:49:54 +00:00
feat: add Exception classes
This commit is contained in:
parent
a136d6dc18
commit
0e1c0a9a13
4 changed files with 718 additions and 3 deletions
|
@ -17,7 +17,7 @@ def try_(p, exc=lambda _: None, els=lambda: None, fin=lambda: None):
|
|||
.try! = unsound.pyeval("try_")
|
||||
assert .try! in |T, U|(
|
||||
p!: () => T,
|
||||
exc!: (exception: Obj) => U := (exception: Obj) => NoneType,
|
||||
exc!: (exception: BaseException) => U := (exception: BaseException) => NoneType,
|
||||
else! := () => NoneType,
|
||||
finally! := () => NoneType,
|
||||
) => T or U
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue