@@ -229,7 +229,8 @@ public void onSuccess(final StorageMetadata storageMetadata) {
229
229
@ Override
230
230
public void onFailure (@ NonNull Exception exception ) {
231
231
Log .e (TAG , "Failure in download " + exception );
232
- callback .invoke (makeErrorPayload (1 , exception ));
232
+ final int errorCode = 1 ;
233
+ callback .invoke (makeErrorPayload (errorCode , exception ));
233
234
}
234
235
});
235
236
@@ -336,13 +337,14 @@ public void onPaused(UploadTask.TaskSnapshot taskSnapshot) {
336
337
StorageMetadata d = taskSnapshot .getMetadata ();
337
338
String bucket = d .getBucket ();
338
339
WritableMap data = Arguments .createMap ();
339
- data .putString ("eventName" , "upload_paused" );
340
+ data .putString ("eventName" , STORAGE_UPLOAD_PAUSED );
340
341
data .putString ("ref" , bucket );
341
- FirestackUtils .sendEvent (getReactApplicationContext (), "upload_paused" , data );
342
+ FirestackUtils .sendEvent (getReactApplicationContext (), STORAGE_UPLOAD_PAUSED , data );
342
343
}
343
344
});
344
345
} catch (Exception ex ) {
345
- callback .invoke (makeErrorPayload (2 , ex ));
346
+ final int errorCode = 2 ;
347
+ callback .invoke (makeErrorPayload (errorCode , ex ));
346
348
}
347
349
}
348
350
@@ -353,7 +355,8 @@ public void getRealPathFromURI(final String uri, final Callback callback) {
353
355
callback .invoke (null , path );
354
356
} catch (Exception ex ) {
355
357
ex .printStackTrace ();
356
- callback .invoke (makeErrorPayload (1 , ex ));
358
+ final int errorCode = 1 ;
359
+ callback .invoke (makeErrorPayload (errorCode , ex ));
357
360
}
358
361
}
359
362
0 commit comments