igniterealtime / REST-API-Client

Java REST API Client for the Openfire to manage Openfire instances by sending an REST/HTTP request to the server
Apache License 2.0
102 stars 62 forks source link

Signal errors with exceptions instead of returning `null` #17

Closed netmikey closed 7 years ago

netmikey commented 8 years ago

In my client code, I want to be able to handle error situations like "channel not found", "bad credentials" etc.

In your current implementation, org.igniterealtime.restclient.RestClient.call(...), you only log error messages in the isStatusCodeOK(...) call, but you ultimately return null on any error. This prevents client code from handling errors accordingly.

Please either let JAXRS' ResponseProcessingException, ProcessingException and WebApplicationException through, or introduce business exceptions for all possible error cases.

Redor commented 7 years ago

Fixed in 1.1.4