diff options
Diffstat (limited to 'objectivec/GPBMessage.h')
-rw-r--r-- | objectivec/GPBMessage.h | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/objectivec/GPBMessage.h b/objectivec/GPBMessage.h index 58c42d02..b3b07793 100644 --- a/objectivec/GPBMessage.h +++ b/objectivec/GPBMessage.h @@ -49,18 +49,14 @@ extern NSString *const GPBMessageErrorDomain; /// Error code for NSError with GPBMessageErrorDomain. typedef NS_ENUM(NSInteger, GPBMessageErrorCode) { - /// The data being parsed is bad and a message can not be created from it. - GPBMessageErrorCodeMalformedData = -100, + /// Uncategorized error. + GPBMessageErrorCodeOther = -100, /// A message can't be serialized because it is missing required fields. GPBMessageErrorCodeMissingRequiredField = -101, }; -#ifdef DEBUG -/// In DEBUG ONLY, an NSException is thrown when a parsed message doesn't -/// contain required fields. This key allows you to retrieve the parsed message -/// from the exception's @c userInfo dictionary. -extern NSString *const GPBExceptionMessageKey; -#endif // DEBUG +/// Key under which the error's reason is stored inside the userInfo dictionary. +extern NSString *const GPBErrorReasonKey; CF_EXTERN_C_END @@ -93,6 +89,9 @@ CF_EXTERN_C_END /// @note In DEBUG builds, the parsed message is checked to be sure all required /// fields were provided, and the parse will fail if some are missing. /// +/// @note The errors returned are likely coming from the domain and codes listed +/// at the top of this file and GPBCodedInputStream.h. +/// /// @param data The data to parse. /// @param errorPtr An optional error pointer to fill in with a failure reason if /// the data can not be parsed. @@ -108,6 +107,9 @@ CF_EXTERN_C_END /// @note In DEBUG builds, the parsed message is checked to be sure all required /// fields were provided, and the parse will fail if some are missing. /// +/// @note The errors returned are likely coming from the domain and codes listed +/// at the top of this file and GPBCodedInputStream.h. +/// /// @param data The data to parse. /// @param extensionRegistry The extension registry to use to look up extensions. /// @param errorPtr An optional error pointer to fill in with a failure @@ -126,6 +128,9 @@ CF_EXTERN_C_END /// @note In DEBUG builds, the parsed message is checked to be sure all required /// fields were provided, and the parse will fail if some are missing. /// +/// @note The errors returned are likely coming from the domain and codes listed +/// at the top of this file and GPBCodedInputStream.h. +/// /// @param input The stream to read data from. /// @param extensionRegistry The extension registry to use to look up extensions. /// @param errorPtr An optional error pointer to fill in with a failure @@ -146,6 +151,9 @@ CF_EXTERN_C_END /// the required fields are set. So this method can be used to reload /// messages that may not be complete. /// +/// @note The errors returned are likely coming from the domain and codes listed +/// at the top of this file and GPBCodedInputStream.h. +/// /// @param input The stream to read data from. /// @param extensionRegistry The extension registry to use to look up extensions. /// @param errorPtr An optional error pointer to fill in with a failure @@ -165,6 +173,9 @@ CF_EXTERN_C_END /// @note In DEBUG builds, the parsed message is checked to be sure all required /// fields were provided, and the parse will fail if some are missing. /// +/// @note The errors returned are likely coming from the domain and codes listed +/// at the top of this file and GPBCodedInputStream.h. +/// /// @param data The data to parse. /// @param errorPtr An optional error pointer to fill in with a failure reason if /// the data can not be parsed. @@ -178,6 +189,9 @@ CF_EXTERN_C_END /// @note In DEBUG builds, the parsed message is checked to be sure all required /// fields were provided, and the parse will fail if some are missing. /// +/// @note The errors returned are likely coming from the domain and codes listed +/// at the top of this file and GPBCodedInputStream.h. +/// /// @param data The data to parse. /// @param extensionRegistry The extension registry to use to look up extensions. /// @param errorPtr An optional error pointer to fill in with a failure @@ -195,6 +209,9 @@ CF_EXTERN_C_END /// the required fields are set. So this method can be used to reload /// messages that may not be complete. /// +/// @note The errors returned are likely coming from the domain and codes listed +/// at the top of this file and GPBCodedInputStream.h. +/// /// @param input The stream to read data from. /// @param extensionRegistry The extension registry to use to look up extensions. /// @param errorPtr An optional error pointer to fill in with a failure |