You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Bryan Duxbury (JIRA)" <ji...@apache.org> on 2009/01/20 01:52:59 UTC

[jira] Created: (THRIFT-278) #validate exceptions should contain the offending value

#validate exceptions should contain the offending value
-------------------------------------------------------

                 Key: THRIFT-278
                 URL: https://issues.apache.org/jira/browse/THRIFT-278
             Project: Thrift
          Issue Type: Improvement
          Components: Compiler (Ruby)
            Reporter: Bryan Duxbury
            Priority: Trivial


If you have an enum field, and its value isn't in the VALID_VALUES of your enum, the exception thrown says that it's not found, but it doesn't say what the value is. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-278) #validate exceptions should contain the offending value

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury updated THRIFT-278:
---------------------------------

    Fix Version/s: 0.1

> #validate exceptions should contain the offending value
> -------------------------------------------------------
>
>                 Key: THRIFT-278
>                 URL: https://issues.apache.org/jira/browse/THRIFT-278
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Ruby)
>            Reporter: Bryan Duxbury
>            Assignee: Piotr Kozikowski
>            Priority: Trivial
>             Fix For: 0.1
>
>
> If you have an enum field, and its value isn't in the VALID_VALUES of your enum, the exception thrown says that it's not found, but it doesn't say what the value is. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-278) #validate exceptions should contain the offending value

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12681908#action_12681908 ] 

Bryan Duxbury commented on THRIFT-278:
--------------------------------------

Is there any reason for this patch not to be committed?

> #validate exceptions should contain the offending value
> -------------------------------------------------------
>
>                 Key: THRIFT-278
>                 URL: https://issues.apache.org/jira/browse/THRIFT-278
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Ruby)
>            Reporter: Bryan Duxbury
>            Assignee: Piotr Kozikowski
>            Priority: Trivial
>             Fix For: 0.1
>
>         Attachments: thrift-278.patch
>
>
> If you have an enum field, and its value isn't in the VALID_VALUES of your enum, the exception thrown says that it's not found, but it doesn't say what the value is. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-278) #validate exceptions should contain the offending value

Posted by "Piotr Kozikowski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12672989#action_12672989 ] 

Piotr Kozikowski commented on THRIFT-278:
-----------------------------------------

I tested it locally. The generated code looks like this:

throw new TProtocolException("The field 'myField' has been assigned the invalid value " + myField);

and it does display the value and not the name.

> #validate exceptions should contain the offending value
> -------------------------------------------------------
>
>                 Key: THRIFT-278
>                 URL: https://issues.apache.org/jira/browse/THRIFT-278
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Ruby)
>            Reporter: Bryan Duxbury
>            Assignee: Piotr Kozikowski
>            Priority: Trivial
>             Fix For: 0.1
>
>         Attachments: thrift-278.patch
>
>
> If you have an enum field, and its value isn't in the VALID_VALUES of your enum, the exception thrown says that it's not found, but it doesn't say what the value is. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-278) #validate exceptions should contain the offending value

Posted by "Kevin Clark (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12681914#action_12681914 ] 

Kevin Clark commented on THRIFT-278:
------------------------------------

Looks fine to me.

> #validate exceptions should contain the offending value
> -------------------------------------------------------
>
>                 Key: THRIFT-278
>                 URL: https://issues.apache.org/jira/browse/THRIFT-278
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Java)
>            Reporter: Bryan Duxbury
>            Assignee: Piotr Kozikowski
>            Priority: Trivial
>             Fix For: 0.1
>
>         Attachments: thrift-278.patch
>
>
> If you have an enum field, and its value isn't in the VALID_VALUES of your enum, the exception thrown says that it's not found, but it doesn't say what the value is. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-278) #validate exceptions should contain the offending value

Posted by "Kevin Clark (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12670064#action_12670064 ] 

Kevin Clark commented on THRIFT-278:
------------------------------------

+1

> #validate exceptions should contain the offending value
> -------------------------------------------------------
>
>                 Key: THRIFT-278
>                 URL: https://issues.apache.org/jira/browse/THRIFT-278
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Ruby)
>            Reporter: Bryan Duxbury
>            Assignee: Piotr Kozikowski
>            Priority: Trivial
>             Fix For: 0.1
>
>
> If you have an enum field, and its value isn't in the VALID_VALUES of your enum, the exception thrown says that it's not found, but it doesn't say what the value is. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-278) #validate exceptions should contain the offending value

Posted by "Kevin Clark (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevin Clark updated THRIFT-278:
-------------------------------

    Component/s:     (was: Compiler (Ruby))
                 Compiler (Java)

> #validate exceptions should contain the offending value
> -------------------------------------------------------
>
>                 Key: THRIFT-278
>                 URL: https://issues.apache.org/jira/browse/THRIFT-278
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Java)
>            Reporter: Bryan Duxbury
>            Assignee: Piotr Kozikowski
>            Priority: Trivial
>             Fix For: 0.1
>
>         Attachments: thrift-278.patch
>
>
> If you have an enum field, and its value isn't in the VALID_VALUES of your enum, the exception thrown says that it's not found, but it doesn't say what the value is. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (THRIFT-278) #validate exceptions should contain the offending value

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury resolved THRIFT-278.
----------------------------------

    Resolution: Fixed

Committed, with slight modifications. Thanks for the patch!

> #validate exceptions should contain the offending value
> -------------------------------------------------------
>
>                 Key: THRIFT-278
>                 URL: https://issues.apache.org/jira/browse/THRIFT-278
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Java)
>            Reporter: Bryan Duxbury
>            Assignee: Piotr Kozikowski
>            Priority: Trivial
>             Fix For: 0.1
>
>         Attachments: thrift-278.patch
>
>
> If you have an enum field, and its value isn't in the VALID_VALUES of your enum, the exception thrown says that it's not found, but it doesn't say what the value is. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-278) #validate exceptions should contain the offending value

Posted by "Piotr Kozikowski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Piotr Kozikowski updated THRIFT-278:
------------------------------------

    Attachment: thrift-278.patch

Patch.

> #validate exceptions should contain the offending value
> -------------------------------------------------------
>
>                 Key: THRIFT-278
>                 URL: https://issues.apache.org/jira/browse/THRIFT-278
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Ruby)
>            Reporter: Bryan Duxbury
>            Assignee: Piotr Kozikowski
>            Priority: Trivial
>             Fix For: 0.1
>
>         Attachments: thrift-278.patch
>
>
> If you have an enum field, and its value isn't in the VALID_VALUES of your enum, the exception thrown says that it's not found, but it doesn't say what the value is. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (THRIFT-278) #validate exceptions should contain the offending value

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury reassigned THRIFT-278:
------------------------------------

    Assignee: Piotr Kozikowski

> #validate exceptions should contain the offending value
> -------------------------------------------------------
>
>                 Key: THRIFT-278
>                 URL: https://issues.apache.org/jira/browse/THRIFT-278
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Ruby)
>            Reporter: Bryan Duxbury
>            Assignee: Piotr Kozikowski
>            Priority: Trivial
>
> If you have an enum field, and its value isn't in the VALID_VALUES of your enum, the exception thrown says that it's not found, but it doesn't say what the value is. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-278) #validate exceptions should contain the offending value

Posted by "Kevin Clark (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12672987#action_12672987 ] 

Kevin Clark commented on THRIFT-278:
------------------------------------

Does this work? Maybe I'm reading it wrong, but:

{{monospaced}}+      indent(out) << "throw new TProtocolException(\"The field '" << field->get_name() << "' has been assigned the invalid value \" + " << field->get_name() << ");" << endl;{{monospaced}}

Looks like it just prints the field name as the value. Got a test?

> #validate exceptions should contain the offending value
> -------------------------------------------------------
>
>                 Key: THRIFT-278
>                 URL: https://issues.apache.org/jira/browse/THRIFT-278
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Ruby)
>            Reporter: Bryan Duxbury
>            Assignee: Piotr Kozikowski
>            Priority: Trivial
>             Fix For: 0.1
>
>         Attachments: thrift-278.patch
>
>
> If you have an enum field, and its value isn't in the VALID_VALUES of your enum, the exception thrown says that it's not found, but it doesn't say what the value is. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (THRIFT-278) #validate exceptions should contain the offending value

Posted by "Kevin Clark (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12672987#action_12672987 ] 

kclark edited comment on THRIFT-278 at 2/12/09 7:23 AM:
-------------------------------------------------------------

Does this work? Maybe I'm reading it wrong, but:

{{+      indent(out) << "throw new TProtocolException(\"The field '" << field->get_name() << "' has been assigned the invalid value \" + " << field->get_name() << ");" << endl;}}

Looks like it just prints the field name as the value. Got a test?

      was (Author: kclark):
    Does this work? Maybe I'm reading it wrong, but:

{{monospaced}}+      indent(out) << "throw new TProtocolException(\"The field '" << field->get_name() << "' has been assigned the invalid value \" + " << field->get_name() << ");" << endl;{{monospaced}}

Looks like it just prints the field name as the value. Got a test?
  
> #validate exceptions should contain the offending value
> -------------------------------------------------------
>
>                 Key: THRIFT-278
>                 URL: https://issues.apache.org/jira/browse/THRIFT-278
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Ruby)
>            Reporter: Bryan Duxbury
>            Assignee: Piotr Kozikowski
>            Priority: Trivial
>             Fix For: 0.1
>
>         Attachments: thrift-278.patch
>
>
> If you have an enum field, and its value isn't in the VALID_VALUES of your enum, the exception thrown says that it's not found, but it doesn't say what the value is. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.