Skip to content

Commit

Permalink
Show URL on error with info
Browse files Browse the repository at this point in the history
  • Loading branch information
ctron committed Sep 30, 2019
1 parent eb1fd4d commit 4160969
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ public void device(final String deviceId, final String username,
.post(RequestBody.create(MT_JSON, "{}" /* empty object */))
.build()).execute()) {

logger.debug("Registration URL - post: {}", newDevice.request().url());

if (!newDevice.isSuccessful()) {

logger.info("Registration URL - post: {}", newDevice.request().url());

throw new RuntimeException(
"Unable to register device: " + deviceId + " -> " + newDevice.code() + ": "
+ newDevice.message());
Expand All @@ -101,9 +102,10 @@ public void device(final String deviceId, final String username,
.build())
.execute()) {

logger.debug("Credentials URL - put: {}", putCredentials.request().url());

if (!putCredentials.isSuccessful()) {

logger.info("Credentials URL - put: {}", putCredentials.request().url());

throw new RuntimeException(
"Unable to register user: " + username + " -> " + putCredentials.code() + ": "
+ putCredentials.message());
Expand Down

0 comments on commit 4160969

Please sign in to comment.