I have a code that looks like this (sorry for the Java bracket style): < Pre> My question The only question thanks to Java! with For information, if it was just class some class {public static zero doSomethingRisky (try {{SomeRiskyFunction ()}} hold (exception e) {throw e; }}} Class main clace {public zero call söshchensi () {try {SomeClass.doSomethingRisky}; } Catch (exception e) {end in the handles the exception (e); Basically,
SomeClass will be a library and I want to design it so that all exceptions can be controlled by the calling program (which may or may not display any message about the exception .)
try / catch & amp;
of
doSomethingRisky () is about to use
SomeClass . Is it redundant or is it necessary? I mean, if I leave it and the function faces an exception during the runtime, will it crash the program because there is no exception in that function, or is it still the collar (
CallSomethingRisky () ) where it is handled in a beautiful way?
try /
hold
Throw e;
doSomethingRisky works in the same way: This stack-trace destroys information that probably is not what it is You wanted to, therefore,
try /
hold should be removed - this will be a bubble already - you expected as expected.
, (instead of
throw e; ) then it would be useless only, rather than destructive
No comments:
Post a Comment