diff options
Diffstat (limited to 'src/org/traccar/location')
-rw-r--r-- | src/org/traccar/location/LocationProvider.java | 2 | ||||
-rw-r--r-- | src/org/traccar/location/OpenCellIdLocationProvider.java | 6 | ||||
-rw-r--r-- | src/org/traccar/location/UniversalLocationProvider.java | 6 |
3 files changed, 6 insertions, 8 deletions
diff --git a/src/org/traccar/location/LocationProvider.java b/src/org/traccar/location/LocationProvider.java index 47b9f8909..ed1494ec3 100644 --- a/src/org/traccar/location/LocationProvider.java +++ b/src/org/traccar/location/LocationProvider.java @@ -23,7 +23,7 @@ public interface LocationProvider { void onSuccess(double latitude, double longitude, double accuracy); - void onFailure(); + void onFailure(Throwable e); } diff --git a/src/org/traccar/location/OpenCellIdLocationProvider.java b/src/org/traccar/location/OpenCellIdLocationProvider.java index b45797b80..a9f815399 100644 --- a/src/org/traccar/location/OpenCellIdLocationProvider.java +++ b/src/org/traccar/location/OpenCellIdLocationProvider.java @@ -55,7 +55,7 @@ public class OpenCellIdLocationProvider implements LocationProvider { json.getJsonNumber("lat").doubleValue(), json.getJsonNumber("lon").doubleValue(), 0); } else { - callback.onFailure(); + callback.onFailure(new IllegalArgumentException("Coordinates are missing")); } } return null; @@ -63,12 +63,12 @@ public class OpenCellIdLocationProvider implements LocationProvider { @Override public void onThrowable(Throwable t) { - callback.onFailure(); + callback.onFailure(t); } }); } else { - callback.onFailure(); + callback.onFailure(new IllegalArgumentException("No network information")); } } diff --git a/src/org/traccar/location/UniversalLocationProvider.java b/src/org/traccar/location/UniversalLocationProvider.java index 7f7028545..63ab681e7 100644 --- a/src/org/traccar/location/UniversalLocationProvider.java +++ b/src/org/traccar/location/UniversalLocationProvider.java @@ -19,7 +19,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.ning.http.client.AsyncCompletionHandler; import com.ning.http.client.Response; import org.traccar.Context; -import org.traccar.helper.Log; import org.traccar.model.Network; import javax.json.Json; @@ -54,12 +53,11 @@ public class UniversalLocationProvider implements LocationProvider { @Override public void onThrowable(Throwable t) { - callback.onFailure(); + callback.onFailure(t); } }); } catch (JsonProcessingException e) { - Log.warning(e); - callback.onFailure(); + callback.onFailure(e); } } |