Index: mojo/public/cpp/bindings/lib/array_serialization.h |
diff --git a/mojo/public/cpp/bindings/lib/array_serialization.h b/mojo/public/cpp/bindings/lib/array_serialization.h |
index 492de788b4530f4997101b8772cd864958e1845b..cce60fdc829503c6c23830ebc5b3ccf9d03edbd8 100644 |
--- a/mojo/public/cpp/bindings/lib/array_serialization.h |
+++ b/mojo/public/cpp/bindings/lib/array_serialization.h |
@@ -104,7 +104,8 @@ template <typename H> struct ArraySerializer<ScopedHandleBase<H>, H, true> { |
MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING( |
IsNonNullableValidationEnabled() && !element_is_nullable && |
!output->at(i).is_valid(), |
- VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE); |
+ VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE, |
+ "invalid handle in array of non-nullable handles"); |
} |
} |
static void DeserializeElements( |
@@ -135,7 +136,8 @@ template <typename S> struct ArraySerializer<S, typename S::Data_*, true> { |
output->at(i) = element; |
MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING( |
IsNonNullableValidationEnabled() && !element_is_nullable && !element, |
- VALIDATION_ERROR_UNEXPECTED_NULL_POINTER); |
+ VALIDATION_ERROR_UNEXPECTED_NULL_POINTER, |
+ "null pointer in array of non-nullable pointers"); |
hansmuller
2014/08/21 00:26:40
You could specify the element index in the error m
yzshen1
2014/08/21 05:57:49
Done.
|
} |
} |
static void DeserializeElements( |
@@ -194,7 +196,8 @@ template <> struct ArraySerializer<String, String_Data*, false> { |
output->at(i) = element; |
MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING( |
IsNonNullableValidationEnabled() && !element_is_nullable && !element, |
- VALIDATION_ERROR_UNEXPECTED_NULL_POINTER); |
+ VALIDATION_ERROR_UNEXPECTED_NULL_POINTER, |
+ "null string in array of non-nullable strings"); |
} |
} |
static void DeserializeElements( |
@@ -223,7 +226,8 @@ inline void SerializeArray_(Array<E> input, internal::Buffer* buf, |
MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING( |
ValidateParams::expected_num_elements != 0 && |
input.size() != ValidateParams::expected_num_elements, |
- internal::VALIDATION_ERROR_UNEXPECTED_ARRAY_HEADER); |
+ internal::VALIDATION_ERROR_UNEXPECTED_ARRAY_HEADER, |
+ "fixed-size array has wrong number of elements"); |
internal::Array_Data<F>* result = |
internal::Array_Data<F>::New(input.size(), buf); |