IMO any decent product should at least fail gracefully and for that
you must have some place at the top catching throwables, even if you
can't recover. So w.r.t. the javadoc in java.lang.Error where it says
"[a] reasonable application should not try to catch." I interpret it
as justification for the throws clause misfeature, but for errors
(incl. asserts) the buck must stop short of an ugly crash. Those whose
bugs come up only during debugging or when asserts are on need not
follow this simple precaution.

On Feb 25, 11:11 am, ".Bill Smith" <william.m.sm...@gmail.com> wrote:
> In the Java world, examples of an Error 
> class<http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Error.html>are
>  LinkageError (indicates
> that a class has some dependency on another class; however, the latter class
> has incompatibly changed after the compilation of the former class),
> NoClassDefFoundError (thrown if the Java Virtual Machine or a 
> ClassLoaderinstance tries to load in the definition of a class (as part of a 
> normal
> method call or as part of creating a new instance using the new expression)
> and no definition of the class could be found.), and (Thrown when the
> "verifier" detects that a class file, though well formed, contains some sort
> of internal inconsistency or security problem).  The general idea is that
> there are circumstances that justify throwing something that a reasonable
> program would not attempt to recover from.  Of course AssertionError is
> another example.
>
> To reiterate what Fogus said, assertions are meant to be a testing/debugging
> tool to identify logic errors, and so assertions throw Errors rather than
> Exceptions.  

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to