aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/core/src/firebase/firestore/util/error_apple.h
diff options
context:
space:
mode:
Diffstat (limited to 'Firestore/core/src/firebase/firestore/util/error_apple.h')
-rw-r--r--Firestore/core/src/firebase/firestore/util/error_apple.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/Firestore/core/src/firebase/firestore/util/error_apple.h b/Firestore/core/src/firebase/firestore/util/error_apple.h
index e31cfd6..e7c77c9 100644
--- a/Firestore/core/src/firebase/firestore/util/error_apple.h
+++ b/Firestore/core/src/firebase/firestore/util/error_apple.h
@@ -24,6 +24,7 @@
#include "Firestore/Source/Public/FIRFirestoreErrors.h" // for FIRFirestoreErrorDomain
#include "Firestore/core/include/firebase/firestore/firestore_errors.h"
+#include "Firestore/core/src/firebase/firestore/util/status.h"
#include "Firestore/core/src/firebase/firestore/util/string_apple.h"
#include "absl/strings/string_view.h"
@@ -32,7 +33,7 @@ namespace firestore {
namespace util {
// Translates a set of error_code and error_msg to an NSError.
-inline NSError* WrapNSError(const int64_t error_code,
+inline NSError* MakeNSError(const int64_t error_code,
const absl::string_view error_msg) {
if (error_code == FirestoreErrorCode::Ok) {
return nil;
@@ -43,6 +44,10 @@ inline NSError* WrapNSError(const int64_t error_code,
userInfo:@{NSLocalizedDescriptionKey : WrapNSString(error_msg)}];
}
+inline NSError* MakeNSError(const util::Status& status) {
+ return MakeNSError(status.code(), status.error_message());
+}
+
} // namespace util
} // namespace firestore
} // namespace firebase