twrongexc.nim 177 B

123456789
  1. discard """
  2. outputsub: "Error: unhandled exception: [ValueError]"
  3. exitcode: "1"
  4. """
  5. try:
  6. raise newException(ValueError, "")
  7. except OverflowDefect:
  8. echo("Error caught")