more error standardisation on android
This commit is contained in:
parent
e48e5c290e
commit
b02bcbd9cf
|
@ -147,8 +147,8 @@ public class RNFirebaseDatabase extends ReactContextBaseJavaModule {
|
||||||
public void onComplete(DatabaseError error, DatabaseReference ref) {
|
public void onComplete(DatabaseError error, DatabaseReference ref) {
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
WritableMap err = Arguments.createMap();
|
WritableMap err = Arguments.createMap();
|
||||||
err.putInt("errorCode", error.getCode());
|
err.putInt("code", error.getCode());
|
||||||
err.putString("errorDetails", error.getDetails());
|
err.putString("details", error.getDetails());
|
||||||
err.putString("description", error.getMessage());
|
err.putString("description", error.getMessage());
|
||||||
callback.invoke(err);
|
callback.invoke(err);
|
||||||
} else {
|
} else {
|
||||||
|
@ -171,11 +171,7 @@ public class RNFirebaseDatabase extends ReactContextBaseJavaModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
public void on(final String path,
|
public void on(final String path, final String modifiersString, final ReadableArray modifiersArray, final String eventName, final Callback callback) {
|
||||||
final String modifiersString,
|
|
||||||
final ReadableArray modifiersArray,
|
|
||||||
final String eventName,
|
|
||||||
final Callback callback) {
|
|
||||||
RNFirebaseDatabaseReference ref = this.getDBHandle(path, modifiersArray, modifiersString);
|
RNFirebaseDatabaseReference ref = this.getDBHandle(path, modifiersArray, modifiersString);
|
||||||
|
|
||||||
if (eventName.equals("value")) {
|
if (eventName.equals("value")) {
|
||||||
|
@ -328,8 +324,8 @@ public class RNFirebaseDatabase extends ReactContextBaseJavaModule {
|
||||||
final DatabaseError databaseError) {
|
final DatabaseError databaseError) {
|
||||||
if (databaseError != null) {
|
if (databaseError != null) {
|
||||||
WritableMap err = Arguments.createMap();
|
WritableMap err = Arguments.createMap();
|
||||||
err.putInt("errorCode", databaseError.getCode());
|
err.putInt("code", databaseError.getCode());
|
||||||
err.putString("errorDetails", databaseError.getDetails());
|
err.putString("details", databaseError.getDetails());
|
||||||
err.putString("description", databaseError.getMessage());
|
err.putString("description", databaseError.getMessage());
|
||||||
callback.invoke(err);
|
callback.invoke(err);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue