THRIFT-690 add new ApplicationExceptions (INTERNAL_ERROR, PROTOCOL_ERROR) to the following languages: as3, c_glib, cocoa, cpp, erl, hs, js, nodejs, ocaml, perl, py, rb

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1153412 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/as3/src/org/apache/thrift/TApplicationError.as b/lib/as3/src/org/apache/thrift/TApplicationError.as
index 93ef946..aa3278d 100644
--- a/lib/as3/src/org/apache/thrift/TApplicationError.as
+++ b/lib/as3/src/org/apache/thrift/TApplicationError.as
@@ -41,6 +41,7 @@
     public static const BAD_SEQUENCE_ID:int = 4;
     public static const MISSING_RESULT:int = 5;
     public static const INTERNAL_ERROR:int = 6;
+    public static const PROTOCOL_ERROR:int = 7;
 
     public function TApplicationError(type:int = UNKNOWN, message:String = "") {
       super(message, type);
diff --git a/lib/c_glib/src/thrift_application_exception.h b/lib/c_glib/src/thrift_application_exception.h
index 369c29b..be5a8c0 100644
--- a/lib/c_glib/src/thrift_application_exception.h
+++ b/lib/c_glib/src/thrift_application_exception.h
@@ -65,7 +65,9 @@
   THRIFT_APPLICATION_EXCEPTION_ERROR_INVALID_MESSAGE_TYPE,
   THRIFT_APPLICATION_EXCEPTION_ERROR_WRONG_METHOD_NAME,
   THRIFT_APPLICATION_EXCEPTION_ERROR_BAD_SEQUENCE_ID,
-  THRIFT_APPLICATION_EXCEPTION_ERROR_MISSING_RESULT
+  THRIFT_APPLICATION_EXCEPTION_ERROR_MISSING_RESULT,
+  THRIFT_APPLICATION_EXCEPTION_ERROR_INTERNAL_ERROR,
+  THRIFT_APPLICATION_EXCEPTION_ERROR_PROTOCOL_ERROR
 } ThriftApplicationExceptionError;
 
 /* define error domain for GError */
diff --git a/lib/cocoa/src/TApplicationException.h b/lib/cocoa/src/TApplicationException.h
index cf1641d..0ad0b9a 100644
--- a/lib/cocoa/src/TApplicationException.h
+++ b/lib/cocoa/src/TApplicationException.h
@@ -26,7 +26,9 @@
   TApplicationException_INVALID_MESSAGE_TYPE = 2,
   TApplicationException_WRONG_METHOD_NAME = 3,
   TApplicationException_BAD_SEQUENCE_ID = 4,
-  TApplicationException_MISSING_RESULT = 5
+  TApplicationException_MISSING_RESULT = 5,
+  TApplicationException_INTERNAL_ERROR = 6,
+  TApplicationException_PROTOCOL_ERROR = 7
 };
 
 // FIXME
diff --git a/lib/cpp/src/TApplicationException.h b/lib/cpp/src/TApplicationException.h
index e125c52..61e6864 100644
--- a/lib/cpp/src/TApplicationException.h
+++ b/lib/cpp/src/TApplicationException.h
@@ -41,7 +41,9 @@
     INVALID_MESSAGE_TYPE = 2,
     WRONG_METHOD_NAME = 3,
     BAD_SEQUENCE_ID = 4,
-    MISSING_RESULT = 5
+    MISSING_RESULT = 5,
+    INTERNAL_ERROR = 6,
+    PROTOCOL_ERROR = 7
   };
 
   TApplicationException() :
diff --git a/lib/erl/include/thrift_constants.hrl b/lib/erl/include/thrift_constants.hrl
index 36eb49b..61d8e1a 100644
--- a/lib/erl/include/thrift_constants.hrl
+++ b/lib/erl/include/thrift_constants.hrl
@@ -51,4 +51,6 @@
 -define(TApplicationException_WRONG_METHOD_NAME, 3).
 -define(TApplicationException_BAD_SEQUENCE_ID, 4).
 -define(TApplicationException_MISSING_RESULT, 5).
+-define(TApplicationException_INTERNAL_ERROR, 6).
+-define(TApplicationException_PROTOCOL_ERROR, 7).
 
diff --git a/lib/hs/src/Thrift.hs b/lib/hs/src/Thrift.hs
index 9b4d41e..e57cff5 100644
--- a/lib/hs/src/Thrift.hs
+++ b/lib/hs/src/Thrift.hs
@@ -50,6 +50,8 @@
     | AE_WRONG_METHOD_NAME
     | AE_BAD_SEQUENCE_ID
     | AE_MISSING_RESULT
+    | AE_INTERNAL_ERROR
+    | AE_PROTOCOL_ERROR
       deriving ( Eq, Show, Typeable )
 
 instance Enum AppExnType where
@@ -59,6 +61,8 @@
     toEnum 3 = AE_WRONG_METHOD_NAME
     toEnum 4 = AE_BAD_SEQUENCE_ID
     toEnum 5 = AE_MISSING_RESULT
+    toEnum 6 = AE_INTERNAL_ERROR
+    toEnum 7 = AE_PROTOCOL_ERROR
     toEnum t = error $ "Invalid AppExnType " ++ show t
 
     fromEnum AE_UNKNOWN = 0
@@ -67,6 +71,8 @@
     fromEnum AE_WRONG_METHOD_NAME = 3
     fromEnum AE_BAD_SEQUENCE_ID = 4
     fromEnum AE_MISSING_RESULT = 5
+    fromEnum AE_INTERNAL_ERROR = 6
+    fromEnum AE_PROTOCOL_ERROR = 7
 
 data AppExn = AppExn { ae_type :: AppExnType, ae_message :: String }
   deriving ( Show, Typeable )
diff --git a/lib/js/thrift.js b/lib/js/thrift.js
index 860cb99..91c4466 100644
--- a/lib/js/thrift.js
+++ b/lib/js/thrift.js
@@ -85,7 +85,9 @@
     'INVALID_MESSAGE_TYPE' : 2,
     'WRONG_METHOD_NAME' : 3,
     'BAD_SEQUENCE_ID' : 4,
-    'MISSING_RESULT' : 5
+    'MISSING_RESULT' : 5,
+    'INTERNAL_ERROR' : 6,
+    'PROTOCOL_ERROR' : 7
 };
 
 Thrift.TApplicationException = function(message, code) {
diff --git a/lib/nodejs/lib/thrift/thrift.js b/lib/nodejs/lib/thrift/thrift.js
index 53ca106..a079001 100644
--- a/lib/nodejs/lib/thrift/thrift.js
+++ b/lib/nodejs/lib/thrift/thrift.js
@@ -57,7 +57,9 @@
   INVALID_MESSAGE_TYPE: 2,
   WRONG_METHOD_NAME: 3,
   BAD_SEQUENCE_ID: 4,
-  MISSING_RESULT: 5
+  MISSING_RESULT: 5,
+  INTERNAL_ERROR: 6,
+  PROTOCOL_ERROR: 7
 }
 
 var TApplicationException = exports.TApplicationException = function(type, message) {
diff --git a/lib/ocaml/src/Thrift.ml b/lib/ocaml/src/Thrift.ml
index fdf2649..bc2d2c3 100644
--- a/lib/ocaml/src/Thrift.ml
+++ b/lib/ocaml/src/Thrift.ml
@@ -292,6 +292,8 @@
       | WRONG_METHOD_NAME
       | BAD_SEQUENCE_ID
       | MISSING_RESULT
+      | INTERNAL_ERROR
+      | PROTOCOL_ERROR
 
   let typ_of_i = function
       0l -> UNKNOWN
@@ -300,6 +302,8 @@
     | 3l -> WRONG_METHOD_NAME
     | 4l -> BAD_SEQUENCE_ID
     | 5l -> MISSING_RESULT
+    | 61 -> INTERNAL_ERROR
+    | 71 -> PROTOCOL_ERROR
     | _ -> raise Thrift_error;;
   let typ_to_i = function
     | UNKNOWN -> 0l
@@ -308,6 +312,8 @@
     | WRONG_METHOD_NAME -> 3l
     | BAD_SEQUENCE_ID -> 4l
     | MISSING_RESULT -> 5l
+    | INTERNAL_ERROR -> 61
+    | PROTOCOL_ERROR -> 71
 
   class t =
   object (self)
diff --git a/lib/perl/lib/Thrift.pm b/lib/perl/lib/Thrift.pm
index ffd6aee..3155714 100644
--- a/lib/perl/lib/Thrift.pm
+++ b/lib/perl/lib/Thrift.pm
@@ -75,6 +75,8 @@
 use constant WRONG_METHOD_NAME    => 3;
 use constant BAD_SEQUENCE_ID      => 4;
 use constant MISSING_RESULT       => 5;
+use constant INTERNAL_ERROR       => 6;
+use constant PROTOCOL_ERROR       => 7;
 
 sub new {
     my $classname = shift;
diff --git a/lib/py/src/Thrift.py b/lib/py/src/Thrift.py
index 91728a7..af6f58d 100644
--- a/lib/py/src/Thrift.py
+++ b/lib/py/src/Thrift.py
@@ -77,6 +77,8 @@
   WRONG_METHOD_NAME = 3
   BAD_SEQUENCE_ID = 4
   MISSING_RESULT = 5
+  INTERNAL_ERROR = 6
+  PROTOCOL_ERROR = 7
 
   def __init__(self, type=UNKNOWN, message=None):
     TException.__init__(self, message)
diff --git a/lib/rb/lib/thrift/exceptions.rb b/lib/rb/lib/thrift/exceptions.rb
index dda7089..2ccc7ce 100644
--- a/lib/rb/lib/thrift/exceptions.rb
+++ b/lib/rb/lib/thrift/exceptions.rb
@@ -35,6 +35,8 @@
     WRONG_METHOD_NAME = 3
     BAD_SEQUENCE_ID = 4
     MISSING_RESULT = 5
+    INTERNAL_ERROR = 6
+    PROTOCOL_ERROR = 7
 
     attr_reader :type
 
@@ -79,4 +81,4 @@
     end
 
   end
-end
\ No newline at end of file
+end