Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(11664)

Issue 3263041: add information to error messages

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 5 months ago by sgk1
Modified:
13 years, 2 months ago
Reviewers:
kenton
Base URL:
http://protobuf.googlecode.com/svn/trunk/
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -3 lines) Patch
M java/src/main/java/com/google/protobuf/Descriptors.java View 2 chunks +6 lines, -3 lines 0 comments Download

Messages

Total messages: 3
sgk1
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
kenton
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
sgk1
13 years, 2 months ago (2011-01-31 19:19:54 UTC) #3
Will do.  --SK

On Sun, Jan 23, 2011 at 2:40 PM, Kenton Varda <kenton@google.com> wrote:

> 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 =
>>
>>
>>
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b