rb: BinaryProtocolAccelerated should use Thrift::ProtocolException [THRIFT-89]
authorDavid Reiss <dreiss@apache.org>
Fri, 25 Jul 2008 21:05:59 +0000 (21:05 +0000)
committerDavid Reiss <dreiss@apache.org>
Fri, 25 Jul 2008 21:05:59 +0000 (21:05 +0000)
BinaryProtocolAccelerated references the deprecated name TProtocolException,
when it should be using Thrift::ProtocolException.
It also uses rb_raise() instead of rb_exc_raise().

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@679897 13f79535-47bb-0310-9956-ffa450edef68

lib/rb/ext/binaryprotocolaccelerated.c

index 2725bfc..31e969e 100644 (file)
@@ -1181,9 +1181,9 @@ static VALUE tbpa_read_message_begin(VALUE self) {
   }
   
   if ((version & VERSION_MASK) != VERSION_1) {
-    VALUE tprotocol_exception = rb_const_get(rb_cObject, rb_intern("TProtocolException"));
+    VALUE tprotocol_exception = rb_const_get(m_thrift, rb_intern("ProtocolException"));
     VALUE exception = rb_funcall(tprotocol_exception, rb_intern("new"), 2, rb_const_get(tprotocol_exception, rb_intern("BAD_VERSION")), rb_str_new2("Missing version identifier"));
-    rb_raise(exception, "");
+    rb_exc_raise(exception);
   }
   
   type = version & 0x000000ff;