Exceptions and overridden methods

From: Milan Gornik (nospam_at_nospam.com)
Date: 03/30/05


Date: Wed, 30 Mar 2005 00:17:04 +0200


Hello guys,

I consulted both MSDN and Borland Builder's documentation to try to find
something about this, but I haven't found it. I saw that both VC++ and
Builder support different kinds of exception handling mechanisms. As I
understand, the standard way is to use exception handling through exception
classes and try/catch statements. Now, in Java, it is mandatory to supply
method prototype with info on which exceptions can occur. This seems to be
supported by Borland C++, and looks like a good way to have good, documented
code. Is it the part of ANSI C++ standard? Furthermore, I was in doubt what
to do if I have inherited class and want to override the parent's class
method. If I have method in base class which declares to throw some
exceptions, compiler would complain if exact set of exceptions were not
supplied by overriding method in derived class. I have situation in which I
would like to add some more possible exceptions in overridden method. Is it
possible, and should I really use this method of documenting possible
exceptions in methods?

Thanks in advance,

Milan Gornik



Relevant Pages

  • Re: The C# Design Process: A Conversation with Anders Hejlsberg
    ... Java establishment and cleverly limns his theories of scalability and ... exception handling is misplaced, he states, yet does so in a gentle way ... exceptions is handling them. ... Delphi/InterBase Weblog: http://delphi.weblogs.com ...
    (borland.public.delphi.non-technical)
  • Re: Functions as receiving items
    ... If I had designed the way CoBOL handled ... C++ exceptions are in some ways more primitive than Smalltalk ... Many subsequent languages, such as Java and the .NET languages, have ... The VAX has some very nice exception handling, ...
    (comp.lang.cobol)
  • Re: opening files and code cleanup
    ... Dan Nagle wrote: ... put on the stack those exceptions which it handles in that frame... ... The Fortran vendors I have with whom I have spoken universally disagree. ... The proper euphamism is "structured exception handling". ...
    (comp.lang.fortran)
  • Re: Divide by 0 - exception thrown?
    ... There is a enough to be said on the topic of exceptions for a book (or ... exceptions), when the OS should have produced a crash dump, instead. ... very nice to have exception handling handle all errors all in one place, ... There are good mini-dump samples here, ...
    (microsoft.public.vc.language)
  • Re: Exceptions and overridden methods
    ... > I consulted both MSDN and Borland Builder's documentation to try to find ... > Builder support different kinds of exception handling mechanisms. ... > method prototype with info on which exceptions can occur. ... > supplied by overriding method in derived class. ...
    (comp.lang.cpp)