I disagree. An aversion to using exceptions is an old prejudice, and trying to avoid their use can lead to some really ugly and buggy code. Even the class loader (at least the Sun version) has exceptions flying all over the place under the covers.
On Jan 18, 3:02 am, Zsolt Vasvari <[email protected]> wrote: > > Have an app that in various activities handles any number of types of > > Exceptions, such as IOException, FileNotFoundException, SAXException, > > etc. In some cases, I want an exception to terminate the called > > Activity and alert the user of an error, in others, I can handle the > > Exception more gracefully, > > By definition, you cannot handle exceptions gracefully. If you can, > you have a design problem as exceptions should never be used as a > replacement for normal flow control. For example, if you use > FileNotFoundException to indicate that you need to create the file, > you should instead be checking the file's existence directly using > file.exists(). FileNotFoundException is all but useless. > > The only exception (not pun intended) is the likes of > NumberFormatException which comes up during parsing. But I'd agrue > that's an artifact of poor API design, where returning a special value > would have been sufficient to indicate a problem. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

