12 Commits

Author SHA1 Message Date
ringabout
26b86c8f4d Makes except: panics on Defect (#24821)
implements https://github.com/nim-lang/RFCs/issues/557


It inserts defect handing into a bare except branch

```nim
try:
  raiseAssert "test"
except:
  echo "nope"
```

=>

```nim
try:
  raiseAssert "test"
except:
  # New behaviov, now well-defined: **never** catches the assert, regardless of panic mode
  raiseDefect()
  echo "nope"
```

In this way, `except` still catches foreign exceptions, but panics on
`Defect`. Probably when Nim has `except {.foreign.}`, we can extend
`raiseDefect` to foreign exceptions as well. That's supposed to be a
small use case anyway.

 `--legacy:noPanicOnExcept` is provided for a transition period.
2025-04-03 16:09:58 +02:00
Andreas Rumpf
6085ad95ff fixes #14279 (#14618) 2020-06-09 20:39:26 +02:00
Jacek Sieka
7d6cbf290a Error -> Defect for defects (#13908)
* Error -> Defect for defects

The distinction between Error and Defect is subjective,
context-dependent and somewhat arbitrary, so when looking at an
exception, it's hard to guess what it is - this happens often when
looking at a `raises` list _without_ opening the corresponding
definition and digging through layers of inheritance.

With the help of a little consistency in naming, it's at least possible
to start disentangling the two error types and the standard lib can set
a good example here.
2020-04-28 19:56:01 +02:00
Araq
4a6d699bc5 C++: make async tests green on Windows 2018-12-21 22:03:41 +01:00
Arne Döring
1105d03644 require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
Andreas Rumpf
0926754e68 make tests green again 2018-07-05 15:51:04 +02:00
Yuriy Glukhov
511d7079a1 Fixed tests 2018-06-06 20:04:37 +03:00
cheatfate
aba60e54d5 Resolve bugs with deep recursion of asyncdispatch.
Introduce callSoon() implementation.
Patch tests to use waitFor() instead of asyncCheck()
2016-05-18 00:53:53 +03:00
Dominik Picheta
3751019823 Fix infinite recursion when await is in except body. 2015-03-30 00:42:21 +01:00
Dominik Picheta
03019849fc Async await try statement fixes. 2015-02-09 23:00:07 +00:00
Dominik Picheta
dd33069d59 Implements getCurrentException for try in async procs. Ref #1487. 2014-09-09 01:16:28 +01:00
Dominik Picheta
6689fa68f5 Multiple exception idents in except for async. Ref #1487. 2014-09-08 22:04:09 +01:00