Re: still confused


[ Follow Ups ] [ Post Followup ] [ CS328 Message Board ] [ FAQ ]

Posted by Natalie on July 15, 2001 at 23:45:43:

In Reply to: Re: still confused posted by Aaron on July 15, 2001 at 23:35:45:

I see what you are saying, but my code is dying in his foo class when a method tries to throw one of these specialized types of exceptions. So, I'm not even getting to my catch block (as far as I can tell). The pointers he has defined in the foo class to these specialized classes must be crap (since the classes are not defined anywhere - that I can see). Thanks for discussing with me.

Natalie

: Holy inheritance hell... He's made a lot of changes to the baz class since i looked at it last... there is a catchall that you can do, i think it's something to the effect of:
: try {}
: catch(...) {}
: and that will catch any exception that is throw in the try block, but I haven't tried it, although the C++ book I have, by Bjarne says it's valid... if you don't care about the spec. baz's try that, it's better than missing a throw all together and watching a segfault

: aaron

: : Natalie

: : : they are defined in baz.cpp and baz.h, which is in the PROJECT_TWO dir... basically a general catch is good enough unless you are doing some trickery such as evicting things when out of room, or creating a success list... in general, and how I am doing mine until i get a better handle on the bookkeeping, is to do something like this
: : : try {
: : : // create foo here
: : : return success;
: : : }
: : : catch(baz e)
: : : {
: : : return failure;
: : : }




Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS328 Message Board ] [ FAQ ]