THRIFT-840. perl: Perl protocol handler could be more robust against unrecognised...
authorBryan Duxbury <bryanduxbury@apache.org>
Thu, 2 Sep 2010 00:24:50 +0000 (00:24 +0000)
committerBryan Duxbury <bryanduxbury@apache.org>
Thu, 2 Sep 2010 00:24:50 +0000 (00:24 +0000)
This patch causes the protocol to throw an exception when it sees an unrecognized type instead of silently doing nothing.

Patch: Conrad Hughes

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

lib/perl/lib/Thrift/Protocol.pm

index 034711f..e2801fe 100644 (file)
@@ -399,8 +399,7 @@ sub skip
         return $result;
     }
 
-
-    return 0;
+    die new Thrift::TException("Type $type not recognised --- corrupt data?");
 
   }
 
@@ -511,8 +510,7 @@ sub skipBinary
         return $result;
     }
 
-    return 0;
-
+    die new Thrift::TException("Type $type not recognised --- corrupt data?");
 }
 
 #