Created
May 22, 2019 16:21
-
-
Save jrfondren/6b4218910bea4f6e453f6c5168c10fbe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type | |
Error1 = object of Exception | |
Error2 = object of Exception | |
proc t1(error: ref Exception) = | |
raise error | |
try: | |
t1(newException(Error1, "foo")) | |
except Error1: | |
echo "got error1" | |
except Exception as e: | |
if e of Error1: | |
echo "got error1 as exception" | |
else: | |
echo "what?" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment