twilio / authy-java

Java Client for Twilio Authy Two-Factor Authentication (2FA) API
https://www.twilio.com/docs/authy/api
MIT License
65 stars 46 forks source link

expose Verification response #50

Closed czhang-hw closed 6 years ago

czhang-hw commented 6 years ago

currently, `try { path.append("start"); response = this.post(path.toString(), params);

  verification.setStatus(this.getStatus());
  verification.setResponse(response);
}

catch(Exception e) {
  e.printStackTrace();
}`

wraps all the exception, even for network errors, but for us, we want to be able to catch the network issues by ourself, so we can notice the problems. One suggestion is to stop catching all Exceptions, but if it's too much, we would like to at least have the access to the response message, so we can somehow figure out it's a network error or not.

suarezjulian commented 6 years ago

@czhang-hw Starting from version 1.3.2 we now wrap exceptions using a class called AuthyException, you can inspect the cause if you want more detail about the error.