35
35
#include " app/src/include/firebase/future.h"
36
36
#include " app/src/reference_counted_future_impl.h"
37
37
#include " firebase/firestore/firestore_version.h"
38
+ #include " firestore/src/common/exception_common.h"
38
39
#include " firestore/src/common/hard_assert_common.h"
39
40
#include " firestore/src/common/macros.h"
40
41
#include " firestore/src/common/util.h"
@@ -55,7 +56,6 @@ using model::DatabaseId;
55
56
using util::AsyncQueue;
56
57
using util::Executor;
57
58
using util::Status;
58
- using util::ThrowInvalidArgument;
59
59
60
60
std::shared_ptr<AsyncQueue> CreateWorkerQueue () {
61
61
auto executor = Executor::CreateSerial (" com.google.firebase.firestore" );
@@ -86,8 +86,12 @@ LoadBundleTaskProgress ToApiProgress(
86
86
87
87
void ValidateDoubleSlash (const char * path) {
88
88
if (std::strstr (path, " //" ) != nullptr ) {
89
- ThrowInvalidArgument (
90
- " Invalid path (%s). Paths must not contain // in them." , path);
89
+ // TODO(b/147444199): use string formatting.
90
+ // ThrowInvalidArgument(
91
+ // "Invalid path (%s). Paths must not contain // in them.", path);
92
+ auto message = std::string (" Invalid path (" ) + path +
93
+ " ). Paths must not contain // in them." ;
94
+ SimpleThrowInvalidArgument (message);
91
95
}
92
96
}
93
97
@@ -138,10 +142,14 @@ DocumentReference FirestoreInternal::Document(const char* document_path) const {
138
142
139
143
Query FirestoreInternal::CollectionGroup (const char * collection_id) const {
140
144
if (std::strchr (collection_id, ' /' ) != nullptr ) {
141
- ThrowInvalidArgument (
142
- " Invalid collection ID (%s). Collection IDs must not contain / in "
143
- " them." ,
144
- collection_id);
145
+ // TODO(b/147444199): use string formatting.
146
+ // ThrowInvalidArgument(
147
+ // "Invalid collection ID (%s). Collection IDs must not contain / in "
148
+ // "them.",
149
+ // collection_id);
150
+ auto message = std::string (" Invalid collection ID (" ) + collection_id +
151
+ " ). Collection IDs must not contain / in them." ;
152
+ SimpleThrowInvalidArgument (message);
145
153
}
146
154
147
155
core::Query core_query = firestore_core_->GetCollectionGroup (collection_id);
0 commit comments