You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Mark Slee (JIRA)" <ji...@apache.org> on 2008/09/29 23:58:44 UTC

[jira] Commented: (THRIFT-150) Exceptions thrown from included files not namespaced properly

    [ https://issues.apache.org/jira/browse/THRIFT-150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635556#action_12635556 ] 

Mark Slee commented on THRIFT-150:
----------------------------------

===================================================================
--- compiler/cpp/src/generate/t_py_generator.cc (revision 700275)
+++ compiler/cpp/src/generate/t_py_generator.cc (working copy)
@@ -1355,7 +1355,7 @@
     indent_down();
     for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
       f_service_ <<
-        indent() << "except " << (*x_iter)->get_type()->get_name() << ", " << (*x_iter)->get_name() << ":" << endl;
+        indent() << "except " << type_name((*x_iter)->get_type()) << ", " << (*x_iter)->get_name() << ":" << endl;
       if (!tfunction->is_async()) {
         indent_up();
         f_service_ <<



> Exceptions thrown from included files not namespaced properly
> -------------------------------------------------------------
>
>                 Key: THRIFT-150
>                 URL: https://issues.apache.org/jira/browse/THRIFT-150
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Python)
>            Reporter: Mark Slee
>
> A namespace is not defined.
> I have a shared.thrift:
> exception InvalidOperation {
>   1: i32 what,
>   2: string why
> }
> In my test.thrift:
> include "shared.thrift"
> service Test {
>  bool my_func(1:i32 something) throws (1:shared.InvalidOperation ouch),
> }
> When this is generated in python, the test class throws an error because the following ends up getting generated:
>     except InvalidOperation, io:
>       result.io = io
> shared.ttypes is not added to the front of InvalidOperation, so python throws an error from the generated class.

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