campyre icon indicating copy to clipboard operation
campyre copied to clipboard

Make CampyreException extend RuntimeException

Open pforhan opened this issue 12 years ago • 7 comments

... 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.

pforhan avatar Dec 13 '12 00:12 pforhan

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.

konklone avatar Dec 13 '12 02:12 konklone

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.

pforhan avatar Dec 13 '12 04:12 pforhan

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

konklone avatar Dec 13 '12 04:12 konklone

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

pforhan avatar Dec 13 '12 04:12 pforhan

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...

konklone avatar Dec 13 '12 04:12 konklone

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...

pforhan avatar Dec 13 '12 17:12 pforhan

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

konklone avatar Dec 13 '12 17:12 konklone