From 73d3f78ada04719b6aacba63b58e8284a4045d98 Mon Sep 17 00:00:00 2001 From: rsgowman Date: Thu, 5 Apr 2018 12:02:15 -0400 Subject: Add error handling for serializer (for serializing case only) (#991) Deserializing not handled yet. Note that the serializing case is fairly uninteresting, as assuming valid input is passed in, there's no real reason why it should fail (and if it does fail, it indicates a gross violation of our understanding of the system.) --- Firestore/core/src/firebase/firestore/remote/serializer.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Firestore/core/src/firebase/firestore/remote/serializer.h') diff --git a/Firestore/core/src/firebase/firestore/remote/serializer.h b/Firestore/core/src/firebase/firestore/remote/serializer.h index 10cacbc..454c3ad 100644 --- a/Firestore/core/src/firebase/firestore/remote/serializer.h +++ b/Firestore/core/src/firebase/firestore/remote/serializer.h @@ -24,6 +24,8 @@ #include "Firestore/Protos/nanopb/google/firestore/v1beta1/document.pb.h" #include "Firestore/core/src/firebase/firestore/model/field_value.h" #include "Firestore/core/src/firebase/firestore/util/firebase_assert.h" +#include "Firestore/core/src/firebase/firestore/util/status.h" +#include "absl/base/attributes.h" namespace firebase { namespace firestore { @@ -70,7 +72,7 @@ class Serializer { // TODO(rsgowman): If we never support any output except to a vector, it may // make sense to have Serializer own the vector and provide an accessor rather // than asking the user to create it first. - static void EncodeFieldValue( + static util::Status EncodeFieldValue( const firebase::firestore::model::FieldValue& field_value, std::vector* out_bytes); -- cgit v1.2.3