3535#include " app/src/include/firebase/future.h"
3636#include " app/src/reference_counted_future_impl.h"
3737#include " firebase/firestore/firestore_version.h"
38+ #include " firestore/src/common/exception_common.h"
3839#include " firestore/src/common/hard_assert_common.h"
3940#include " firestore/src/common/macros.h"
4041#include " firestore/src/common/util.h"
@@ -55,7 +56,6 @@ using model::DatabaseId;
5556using util::AsyncQueue;
5657using util::Executor;
5758using util::Status;
58- using util::ThrowInvalidArgument;
5959
6060std::shared_ptr<AsyncQueue> CreateWorkerQueue () {
6161 auto executor = Executor::CreateSerial (" com.google.firebase.firestore" );
@@ -86,8 +86,12 @@ LoadBundleTaskProgress ToApiProgress(
8686
8787void ValidateDoubleSlash (const char * path) {
8888 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);
9195 }
9296}
9397
@@ -138,10 +142,14 @@ DocumentReference FirestoreInternal::Document(const char* document_path) const {
138142
139143Query FirestoreInternal::CollectionGroup (const char * collection_id) const {
140144 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);
145153 }
146154
147155 core::Query core_query = firestore_core_->GetCollectionGroup (collection_id);
0 commit comments