Had this sitting in my copy of protobuf-2.3.0, the additional info helped when I was ...
13 years, 5 months ago
(2010-11-23 00:48:52 UTC)
#1
Had this sitting in my copy of protobuf-2.3.0, the additional info helped when I
was debugging my mistakes. LMK if you'd rather I submit this internally or to
someone else.
Can you update this patch to the current protobuf SVN sources? On Mon, Nov 22, ...
13 years, 3 months ago
(2011-01-23 22:41:09 UTC)
#2
Can you update this patch to the current protobuf SVN sources?
On Mon, Nov 22, 2010 at 4:48 PM, <sgk@google.com> wrote:
> Reviewers: kenton,
>
> Message:
> Had this sitting in my copy of protobuf-2.3.0, the additional info
> helped when I was debugging my mistakes. LMK if you'd rather I submit
> this internally or to someone else.
>
>
>
> Please review this at http://codereview.appspot.com/3263041/
>
> Affected files:
> M java/src/main/java/com/google/protobuf/Descriptors.java
>
>
> Index: java/src/main/java/com/google/protobuf/Descriptors.java
> ===================================================================
> --- java/src/main/java/com/google/protobuf/Descriptors.java (revision
> 350)
> +++ java/src/main/java/com/google/protobuf/Descriptors.java (working
> copy)
> @@ -232,13 +232,15 @@
> if (dependencies.length != proto.getDependencyCount()) {
> throw new DescriptorValidationException(result,
> "Dependencies passed to FileDescriptor.buildFrom() don't match "
> +
> - "those listed in the FileDescriptorProto.");
> + "those listed in the FileDescriptorProto: lengths " +
> + dependencies.length + " != " + proto.getDependencyCount());
> }
> for (int i = 0; i < proto.getDependencyCount(); i++) {
> if (!dependencies[i].getName().equals(proto.getDependency(i))) {
> throw new DescriptorValidationException(result,
> "Dependencies passed to FileDescriptor.buildFrom() don't match
> " +
> - "those listed in the FileDescriptorProto.");
> + "those listed in the FileDescriptorProto: index " + i + ": " +
> + dependencies[i].getName() + " != " + proto.getDependency(i));
> }
> }
>
> @@ -292,7 +294,8 @@
> result = buildFrom(proto, dependencies);
> } catch (DescriptorValidationException e) {
> throw new IllegalArgumentException(
> - "Invalid embedded descriptor for \"" + proto.getName() + "\".",
> e);
> + "Invalid embedded descriptor for \"" + proto.getName() + "\": "
> +
> + e.getDescription(), e);
> }
>
> final ExtensionRegistry registry =
>
>
>
Issue 3263041: add information to error messages
Created 13 years, 5 months ago by sgk1
Modified 13 years, 3 months ago
Reviewers: kenton
Base URL: http://protobuf.googlecode.com/svn/trunk/
Comments: 0