Skip to content

Instantly share code, notes, and snippets.

@ftsf
Created June 16, 2017 05:48
Show Gist options
  • Save ftsf/2da6d5abce35eec083a061dd5cacdc43 to your computer and use it in GitHub Desktop.
Save ftsf/2da6d5abce35eec083a061dd5cacdc43 to your computer and use it in GitHub Desktop.
type MyNewException = ref object of Exception
foo*: int
try:
var newE = new(MyNewException)
newE.msg = "foo"
newE.foo = 10
raise newE
except MyNewException:
let e = getCurrentException().MyNewException
echo e.foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment