Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Update GeoFire.java #27

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/main/java/com/firebase/geofire/GeoFire.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}
}
}
Expand Down