Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create specific exception instead of generic Exception #175

Closed
lsoares opened this issue Aug 27, 2016 · 6 comments
Closed

Create specific exception instead of generic Exception #175

lsoares opened this issue Aug 27, 2016 · 6 comments

Comments

@lsoares
Copy link

lsoares commented Aug 27, 2016

try {
    req.await();
    // "other code"
} catch (Exception e) {
}

Dealing with generic exceptions creates some dangers. I propose that you create a specific exception (or more) like GeocodingException or likewise.

Otherwise, I may be be preventing runtime exceptions (and also catched exceptions) under "other code" to bubble up...

(I can also do it as PR if you prefer.)

@domesticmouse
Copy link
Contributor

I'm always up for reviewing PRs. Thanks!

@pieteradejong
Copy link

the code fragment refers to the readme.
is the intention to update the readme,
or to modify (make more specific) (some of) the 9 occurrences thoughout the code?

@lsoares
Copy link
Author

lsoares commented Jan 18, 2017 via email

@pieteradejong
Copy link

@lsoares do you see a path toward breaking it up into smaller pieces?

@lsoares
Copy link
Author

lsoares commented Jan 19, 2017

What if await under PendingResult throws an application exception (e.g. GoogleMapsException) instead of Exception? That would be a start I guess.

@domesticmouse
Copy link
Contributor

I'm going to close this out for now. Please feel free to submit either the uber-PR or a series of smaller PRs. I'm about to break the world by migrating from OkHttp2 to OkHttp3, however...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants