digitalmars.D - AssertError or AssertException?
- zwang (8/8) May 29 2005 /dbc.html states:
- Jarrett Billingsley (9/17) May 29 2005 dmd/src/phobos/std/asserterror.d has a definition for an AssertError cla...
- zwang (2/30) May 29 2005 Thanks!
/dbc.html states: "an assert in function bodies works by throwing an AssertException, which can be caught and handled." /expression.html#AssertExpression says: "Asserts evaluate the expression. If the result is false, an AssertError is thrown." Which statement is correct? How to catch an assertion exception?
May 29 2005
"zwang" <nehzgnaw gmail.com> wrote in message news:d7co51$2p14$1 digitaldaemon.com.../dbc.html states: "an assert in function bodies works by throwing an AssertException, which can be caught and handled." /expression.html#AssertExpression says: "Asserts evaluate the expression. If the result is false, an AssertError is thrown." Which statement is correct? How to catch an assertion exception?dmd/src/phobos/std/asserterror.d has a definition for an AssertError class. So you'd use catch(AssertError ae) { } to catch an AssertError. This also means that dbc.html has a typo.
May 29 2005
Jarrett Billingsley wrote:"zwang" <nehzgnaw gmail.com> wrote in message news:d7co51$2p14$1 digitaldaemon.com...Thanks!/dbc.html states: "an assert in function bodies works by throwing an AssertException, which can be caught and handled." /expression.html#AssertExpression says: "Asserts evaluate the expression. If the result is false, an AssertError is thrown." Which statement is correct? How to catch an assertion exception?dmd/src/phobos/std/asserterror.d has a definition for an AssertError class. So you'd use catch(AssertError ae) { } to catch an AssertError. This also means that dbc.html has a typo.
May 29 2005