Skip to content

Commit 2bcfcc2

Browse files
authored
remove NSException from firestore client (#4131)
1 parent e241a9a commit 2bcfcc2

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

Firestore/core/src/firebase/firestore/core/firestore_client.mm

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,12 @@ new FirestoreClient(database_info, std::move(credentials_provider),
161161
auto created = LevelDbPersistence::Create(
162162
std::move(dir), serializer,
163163
LruParams::WithCacheSize(settings.cache_size_bytes()));
164-
if (!created.ok()) {
165-
// If leveldb fails to start then just throw up our hands: the error is
166-
// unrecoverable. There's nothing an end-user can do and nearly all
167-
// failures indicate the developer is doing something grossly wrong so we
168-
// should stop them cold in their tracks with a failure they can't ignore.
169-
[NSException
170-
raise:NSInternalInconsistencyException
171-
format:@"Failed to open DB: %s", created.status().ToString().c_str()];
172-
}
164+
// If leveldb fails to start then just throw up our hands: the error is
165+
// unrecoverable. There's nothing an end-user can do and nearly all
166+
// failures indicate the developer is doing something grossly wrong so we
167+
// should stop them cold in their tracks with a failure they can't ignore.
168+
HARD_ASSERT(created.ok(), "Failed to open DB: %s",
169+
created.status().ToString());
173170

174171
auto ldb = std::move(created).ValueOrDie();
175172
lru_delegate_ = ldb->reference_delegate();

0 commit comments

Comments
 (0)