diff options
author | Oliver Schramm <oliver.schramm97@gmail.com> | 2021-06-24 19:44:46 +0200 |
---|---|---|
committer | Oliver Schramm <oliver.schramm97@gmail.com> | 2021-06-24 19:44:46 +0200 |
commit | 93d750a57b7ecdcad6e62bf75b97e804d7f45eac (patch) | |
tree | 4ad42249c36c8f3cfa4b8cd46e3df8f6c68e2681 /src/main/java/org/traccar/geocoder | |
parent | 48670633fd49e3ec2bd781f858b11ccd2083878d (diff) | |
download | traccar-server-93d750a57b7ecdcad6e62bf75b97e804d7f45eac.tar.gz traccar-server-93d750a57b7ecdcad6e62bf75b97e804d7f45eac.tar.bz2 traccar-server-93d750a57b7ecdcad6e62bf75b97e804d7f45eac.zip |
Catch all webexceptions in JsonGeocoder
When a service is down (like positionstack recently often is),
it might send a 503 Service Unavailable which is not covered
by a ClientErrorException. Using the superclass of this, will
enable the position to be handled correctly still.
Diffstat (limited to 'src/main/java/org/traccar/geocoder')
-rw-r--r-- | src/main/java/org/traccar/geocoder/JsonGeocoder.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/geocoder/JsonGeocoder.java b/src/main/java/org/traccar/geocoder/JsonGeocoder.java index 4f34fb973..3cd5b596e 100644 --- a/src/main/java/org/traccar/geocoder/JsonGeocoder.java +++ b/src/main/java/org/traccar/geocoder/JsonGeocoder.java @@ -22,7 +22,7 @@ import org.traccar.Main; import org.traccar.database.StatisticsManager; import javax.json.JsonObject; -import javax.ws.rs.ClientErrorException; +import javax.ws.rs.WebApplicationException; import javax.ws.rs.client.Invocation; import javax.ws.rs.client.InvocationCallback; import java.util.AbstractMap; @@ -116,7 +116,7 @@ public abstract class JsonGeocoder implements Geocoder { } else { try { return handleResponse(latitude, longitude, request.get(JsonObject.class), null); - } catch (ClientErrorException e) { + } catch (WebApplicationException e) { LOGGER.warn("Geocoder network error", e); } } |