Conversation
…n with url, http responseCode and http responseMessage to help exception handling.
|
@reviewbybees esp @recena @oleg-nenashev |
|
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
| retrieve().to("/user", GHUser.class); | ||
| return true; | ||
| } catch (IOException e) { | ||
| logger.log(Level.FINEST, "Exception validating credentials on {0} with login {1}: {2}", new Object[]{this.apiUrl, this.login, e, e}); |
There was a problem hiding this comment.
Probably FINE would be appropriate.
There was a problem hiding this comment.
🐛 you are trying to pass four parameters to a three-argument message parameter; probably you meant to put the last e outside the braces, but this does not work because the preformatted overloads do not also accept Throwable. Also including Throwable.toString in the message is pointless when you are including the full stack trace anyway. So what you meant was probably something like
logger.log(Level.FINE, "Exception validating credentials on " + apiUrl + " with login " + login, e);There was a problem hiding this comment.
Thanks, I'll never get on well with java.util.logging :-)
|
@jglick I have updated the code according to your recommendations! |
Better error message:
FINESTlog message inGitHub.isCredentialsValid()in case of exception as we silently swallow this exception.