konklone / campyre

RETIRED: A Campfire client for Android.
https://play.google.com/store/apps/details?id=campyre.android
BSD 3-Clause "New" or "Revised" License
68 stars 22 forks source link

Make CampyreException extend RuntimeException #148

Open pforhan opened 11 years ago

pforhan commented 11 years ago

... this would probably clean up a lot of code. Though we'd still need to catch in some places, so I'm not sure what this would do to stability and consistency. Need to look closer at the code.

konklone commented 11 years ago

I am instinctively nervous about this - it might catch more errors, but fewer underlying issues would end up rolling into the Android market's bug reports list.

Happy to give you access to the reports list, if you want to look through the bug reports.

pforhan commented 11 years ago

Not sure quite what you mean... RuntimeExceptions are still caught by the UncaughtExceptionHandler, and uploaded if the user chooses.

But anyway, I'm not keen on getting this right at this moment. It's pretty low priority, generally.

konklone commented 11 years ago

...oh, I think I misunderstood what you were suggesting. What's the effect of extending RuntimeException?

pforhan commented 11 years ago

It means you don't have to catch (CampyreException) or declare throws CampyreException all over the place.

konklone commented 11 years ago

Right now, everywhere I catch CampyreException, I think I want to, so I can turn it into a toast or something. Is there anywhere I could get rid of the catch without affecting the app's behavior?

I'd love to get rid of the "throws" clauses...

pforhan commented 11 years ago

That'd be a quick change to make, I think, and safest for now. We'd just have to watch out that we don't forget to catch in similar situations with new code...

konklone commented 11 years ago

If it's just an aesthetic improvement, I think I'd feel better with the explicit catches that we have now...