File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
firebase-config/src/main/java/com/google/firebase/remoteconfig Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 23
23
import com .google .android .gms .tasks .Task ;
24
24
import com .google .android .gms .tasks .Tasks ;
25
25
import com .google .firebase .FirebaseApp ;
26
+ import com .google .firebase .FirebaseError ;
27
+ import com .google .firebase .FirebaseException ;
26
28
import com .google .firebase .abt .AbtException ;
27
29
import com .google .firebase .abt .FirebaseABTesting ;
28
30
import com .google .firebase .emulators .EmulatedServiceSettings ;
@@ -580,8 +582,14 @@ public ConfigUpdateListenerRegistration addOnConfigUpdateListener(
580
582
*
581
583
* @param host the emulator host (for example, 10.0.2.2)
582
584
* @param port the emulator port (for example, 9299)
585
+ *
586
+ * @exception FirebaseRemoteConfigClientException Thrown when useEmulator is called after a fetch.
583
587
*/
584
- public void useEmulator (@ NonNull String host , int port ) {
588
+ public void useEmulator (@ NonNull String host , int port ) throws FirebaseRemoteConfigClientException {
589
+ if (this .frcMetadata .getInfo ().getLastFetchStatus () != LAST_FETCH_STATUS_NO_FETCH_YET ) {
590
+ throw new FirebaseRemoteConfigClientException (
591
+ "Cannot connect to emulator after a fetch has been made." );
592
+ }
585
593
fetchHandler .setEmulatedServiceSettings (new EmulatedServiceSettings (host , port ));
586
594
}
587
595
You can’t perform that action at this time.
0 commit comments