add error check for request
Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
@@ -52,6 +52,9 @@ public class TimezoneServiceImpl implements TimezoneService {
|
|||||||
.get()
|
.get()
|
||||||
.uri("https://worldtimeapi.org/api/ip/" + ip)
|
.uri("https://worldtimeapi.org/api/ip/" + ip)
|
||||||
.retrieve()
|
.retrieve()
|
||||||
|
.onStatus(HttpStatusCode::is4xxClientError, (request, response) -> {
|
||||||
|
throw new NotFoundException();
|
||||||
|
})
|
||||||
.body(WorldTimeApiIpResponse.class);
|
.body(WorldTimeApiIpResponse.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user