Skip to content

Commit

Permalink
refactor(UsGdot...Notifier): Improve logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
binh-dam-ibigroup committed Dec 4, 2024
1 parent 5c78b43 commit 018af78
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,26 @@ public boolean triggerPedestrianCall(String signalId, String crossingId, boolean
return true;
} else {
String pathAndQuery = getUrl(signalId, crossingId, extended);
LOG.info("About to trigger pedestrian call at {}", pathAndQuery);
var httpResponse = HttpUtils.httpRequestRawResponse(
URI.create(pathAndQuery),
30,
HttpMethod.POST,
getHeaders(),
""
);
if (httpResponse.status == HttpStatus.OK_200) {
LOG.info("Triggered pedestrian call {}", pathAndQuery);
if (httpResponse != null && httpResponse.status == HttpStatus.OK_200) {
LOG.info("Triggered pedestrian call at {}", pathAndQuery);
return true;
} else if (httpResponse == null) {
LOG.error("Unable to reach Ped-X server at {}", pathAndQuery);
} else {
LOG.error("Error {} while triggering pedestrian call {}", httpResponse.status, pathAndQuery);
LOG.error("Error {} while triggering pedestrian call at {}", httpResponse.status, pathAndQuery);
}
}
} catch (InterruptedException e) {
// Continue with the rest.
// Log and continue with the rest.
LOG.error("Ped-X request was interrupted: {}", e.getMessage());
}
}
return false;
Expand Down

0 comments on commit 018af78

Please sign in to comment.