keenlabs / KeenClient-Java

Official Java client for the Keen IO API. Build analytics features directly into your Java apps.
https://keen.io/docs
MIT License
74 stars 43 forks source link

ServerException vs KeenQueryClientException #101

Open masojus opened 7 years ago

masojus commented 7 years ago

KeenQueryClientException seems to have been created as the exception that should be thrown out of KeenQueryClient and the comment says that even includes errors reported by the server:

Exceptions thrown by KeenQueryClient. This includes errors reported by the server.

But, there are several places where we throw ServerException out of KeenQueryClient instead. Is there a reason for this, or was it just an oversight? What should we throw in those cases?

What about for new code like Saved/Cached Query code in PR #96? That's not technically KeenQueryClient so is a new exception class desirable?

masojus commented 7 years ago

Also, changing the exception type thrown out of a core method could alter how client code works since they'll no longer catch the right exception, but I'm not sure how changing an exceptional case affects semver, so I wonder if that type of change would have to wait for a major revision.