digitalmars.D.learn - Where did AssertError go?
- Jonathan M Davis (3/3) Nov 17 2008 I'm trying to catch an AssertError in some of my code, but I don't know ...
- Jarrett Billingsley (7/8) Nov 17 2008 Yes, at least it was supposed to have. I think the module is just
- Jonathan M Davis (3/19) Nov 17 2008 Using AssertException and importing core.exception does indeed appear to...
- Jarrett Billingsley (6/25) Nov 17 2008 Ah, I thought I saw this somewhere.
- Sean Kelly (4/7) Nov 18 2008 Alias AssertException to AssertError for now. It will be renamed to
I'm trying to catch an AssertError in some of my code, but I don't know how to import it with D 2.020. I believe that it used to be in std.asserterror, but that module doesn't appear to exist anymore and I can't figure out where it is. There's an AssertException in src/common/core/exception.d. Did that replace AssertError (the documentation talks about assert throwing AssertErrors though, not AssertExceptions)? Regardless, importing common.core.exception doesn't work. Do failed assertions throw AssertError or AssertException? And what do I have to do in order to be able to catch the appropriate one in my code? - Jonathan M Davis
Nov 17 2008
On Mon, Nov 17, 2008 at 11:50 PM, Jonathan M Davis <jmdavisProg gmail.com> wrote:I'm trying to catch an AssertError in some of my code, but I don't know how to import it with D 2.020. I believe that it used to be in std.asserterror, but that module doesn't appear to exist anymore and I can't figure out where it is. There's an AssertException in src/common/core/exception.d. Did that replace AssertError (the documentation talks about assert throwing AssertErrors though, not AssertExceptions)? Regardless, importing common.core.exception doesn't work.Yes, at least it was supposed to have. I think the module is just imported as core.exception, though, not common.core.exception. The documentation most likely has not yet been updated since this change just happened in the last update since Phobos now uses druntime for the features it has in common with Tango.
Nov 17 2008
Jarrett Billingsley wrote:On Mon, Nov 17, 2008 at 11:50 PM, Jonathan M Davis <jmdavisProg gmail.com> wrote:Using AssertException and importing core.exception does indeed appear to have done the trick. Thanks. - Jonathan M DavisI'm trying to catch an AssertError in some of my code, but I don't know how to import it with D 2.020. I believe that it used to be in std.asserterror, but that module doesn't appear to exist anymore and I can't figure out where it is. There's an AssertException in src/common/core/exception.d. Did that replace AssertError (the documentation talks about assert throwing AssertErrors though, not AssertExceptions)? Regardless, importing common.core.exception doesn't work.Yes, at least it was supposed to have. I think the module is just imported as core.exception, though, not common.core.exception. The documentation most likely has not yet been updated since this change just happened in the last update since Phobos now uses druntime for the features it has in common with Tango.
Nov 17 2008
On Tue, Nov 18, 2008 at 1:06 AM, Jonathan M Davis <jmdavisProg gmail.com> wrote:Jarrett Billingsley wrote:Ah, I thought I saw this somewhere. http://www.digitalmars.com/d/2.0/changelog.html The changelog for 2.020 lists most/all of the changes that you'll have to make when you switch to it. std.asserterror and AssertError are among the changes ;)On Mon, Nov 17, 2008 at 11:50 PM, Jonathan M Davis <jmdavisProg gmail.com> wrote:Using AssertException and importing core.exception does indeed appear to have done the trick. Thanks. - Jonathan M DavisI'm trying to catch an AssertError in some of my code, but I don't know how to import it with D 2.020. I believe that it used to be in std.asserterror, but that module doesn't appear to exist anymore and I can't figure out where it is. There's an AssertException in src/common/core/exception.d. Did that replace AssertError (the documentation talks about assert throwing AssertErrors though, not AssertExceptions)? Regardless, importing common.core.exception doesn't work.Yes, at least it was supposed to have. I think the module is just imported as core.exception, though, not common.core.exception. The documentation most likely has not yet been updated since this change just happened in the last update since Phobos now uses druntime for the features it has in common with Tango.
Nov 17 2008
Jonathan M Davis wrote:I'm trying to catch an AssertError in some of my code, but I don't know how to import it with D 2.020. I believe that it used to be in std.asserterror, but that module doesn't appear to exist anymore and I can't figure out where it is. There's an AssertException in src/common/core/exception.d. Did that replace AssertError (the documentation talks about assert throwing AssertErrors though, not AssertExceptions)? Regardless, importing common.core.exception doesn't work. Do failed assertions throw AssertError or AssertException? And what do I have to do in order to be able to catch the appropriate one in my code?Alias AssertException to AssertError for now. It will be renamed to AssertError in 2.021. Sean
Nov 18 2008