 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
crhras Guest
|
Posted: Fri Aug 25, 2006 4:50 am Post subject: Exceptions |
|
|
How can I find the exceptions that a method might throw ?
For example, I want to put a call to TDataset->Post() inside a try/catch
block and I can't find the possible exceptions. I am asking this question
here because it seems like the IDE might be able to pull this info up.
Thanks,
Curt |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri Aug 25, 2006 7:12 am Post subject: Re: Exceptions |
|
|
"crhras" <crhras (AT) sbcglobal (DOT) net> wrote in message
news:44ee3b53$1 (AT) newsgroups (DOT) borland.com...
| Quote: | How can I find the exceptions that a method might throw ?
|
Unless it is in the method's documentation, or you have the method's source
code, then you don't.
| Quote: | For example, I want to put a call to TDataset->Post() inside a
try/catch block and I can't find the possible exceptions.
|
You don't need to know every possible specific exception type in order to do
that. All VCL exceptions ultimately derive from the Exception class, so you
can catch that instead, ie:
try
{
Dataset1->Post();
}
catch(const Exception &e) // all VCL exceptions
{
ShowMessage("Exception Type: " + AnsiString(e.ClassName) + ",
Message: " + e.Message);
}
| Quote: | I am asking this question here because it seems like the
IDE might be able to pull this info up.
|
That is a very different issue. The IDE's debugger can determine the exact
exception type that is being thrown, because that is what a debugger is
designed to do.
Gambit |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|