Skip to content

Instantly share code, notes, and snippets.

@jrfondren
Created May 22, 2019 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrfondren/6b4218910bea4f6e453f6c5168c10fbe to your computer and use it in GitHub Desktop.
Save jrfondren/6b4218910bea4f6e453f6c5168c10fbe to your computer and use it in GitHub Desktop.
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