Skip to content

Commit ad03abc

Browse files
committed
Change the Release Notes and change the UseEmulator to give errors
1 parent de56bde commit ad03abc

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

release_build_files/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ workflow use only during the development of your app, not for publicly shipping
613613
code.
614614

615615
## Release Notes
616-
### 13.3.0
616+
### Upcoming
617617
- Changes
618618
- Storage: Add support for Firebase Storage emulator via `UseEmulator`.
619619
The `UseEmulator` method should be called before invoking any other

storage/src/desktop/storage_desktop.cc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "app/src/app_common.h"
2424
#include "app/src/function_registry.h"
2525
#include "app/src/include/firebase/app.h"
26+
#include "app/src/log.h"
2627
#include "storage/src/desktop/rest_operation.h"
2728
#include "storage/src/desktop/storage_reference_desktop.h"
2829

@@ -138,23 +139,26 @@ void StorageInternal::CleanupCompletedOperations() {
138139

139140
void StorageInternal::UseEmulator(const char* host, int port) {
140141
if (host == nullptr || host[0] == '\0') {
141-
throw std::invalid_argument("Emulator host cannot be null or empty.");
142+
LogError("Emulator host cannot be null or empty.");
143+
return;
142144
}
143-
host_ = host;
144145

145146
if (port <= 0) {
146-
throw std::invalid_argument("Emulator port must be a positive number.");
147+
LogError("Emulator port must be a positive number.");
148+
return;
147149
}
148-
port_ = port;
149150

150151
if (configured_) {
151-
throw std::logic_error(
152+
LogError(
152153
"Cannot connect to emulator after Storage SDK initialization. "
153154
"Call use_emulator(host, port) before creating a Storage "
154155
"reference or trying to load data.");
156+
return;
155157
}
156158

157159
scheme_ = "http";
160+
port_ = port;
161+
host_ = host;
158162
}
159163

160164
} // namespace internal

0 commit comments

Comments
 (0)