Re: Exceptions
shaunpatterson@xxxxxxxxx writes:
Is there any way to force programmers to catch exception that
your function throws? Something like Java forcing coders to
put try/catch blocks
What do you mean by "force"?
If your function throws an exception, in Ada or Java, the runtime
semantics define what happens.
If a caller of your function wants to handle the exception, they can.
If they don't want to, they can do that as well.
What is the use case you have in mind?
--
-- Stephe
.
Relevant Pages
- Exceptions
... Is there any way to force programmers to catch exception that ... Something like Java forcing coders to ... put try/catch blocks ... (comp.lang.ada) - Re: Exceptions
... -- And raises an exception, if K is Zero ... Something like Java forcing coders to ... put try/catch blocks ... (comp.lang.ada) - Re: CSingleLock - known behaviour?
... But then you have problems with exception safety and early returns. ... If I were to use CSingleLock for the first time ever, ... Writing try/catch blocks clutters the code in a big way, ... duplicate code as you've done above to handle the exception and ... (microsoft.public.vc.mfc) - Re: Try Catch Else Finally
... Catch ex As Exception ... Nested try/catch blocks look pretty ugly and are hard to follow. ... The finally statements are different because they execute after the Try if no errors happened. ... Or if the different things threw different types of exceptions, you could have multiple catch blocks each catching a different exception type, and have different error handling code execute that way. ... (microsoft.public.dotnet.languages.vb) - Re: Are codes ran in try blocks expensive?
... If an exception is thrown, ... a higher cost. ... because you have one too many try/catch blocks. ... (microsoft.public.dotnet.languages.vb) |
|