KeenClient-Java icon indicating copy to clipboard operation
KeenClient-Java copied to clipboard

ServerException vs KeenQueryClientException

Open masojus opened this issue 8 years ago • 1 comments

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 avatar May 17 '17 08:05 masojus

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.

masojus avatar May 17 '17 08:05 masojus