diff --git a/src/main/java/com/firebase/geofire/GeoFire.java b/src/main/java/com/firebase/geofire/GeoFire.java index 5bd1eb9..cc7f09c 100644 --- a/src/main/java/com/firebase/geofire/GeoFire.java +++ b/src/main/java/com/firebase/geofire/GeoFire.java @@ -31,6 +31,7 @@ import com.firebase.geofire.core.GeoHash; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; +import com.google.firebase.database.DatabaseException; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.ValueEventListener; import com.google.firebase.database.GenericTypeIndicator; @@ -76,8 +77,9 @@ public void onDataChange(DataSnapshot dataSnapshot) { if (location != null) { this.callback.onLocationResult(dataSnapshot.getKey(), location); } else { - String message = "GeoFire data has invalid format: " + dataSnapshot.getValue(); - this.callback.onCancelled(DatabaseError.fromStatus(message)); + String message = "GeoFire data has invalid format: " + dataSnapshot.getValue() + DatabaseException exception = new DatabaseException(message); + this.callback.onCancelled(DatabaseError.fromException(exception)); } } }