Author: roger Date: Wed Aug 3 09:49:27 2011 New Revision: 1153412 URL: http://svn.apache.org/viewvc?rev=1153412&view=rev Log: 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
Modified: thrift/trunk/lib/as3/src/org/apache/thrift/TApplicationError.as thrift/trunk/lib/c_glib/src/thrift_application_exception.h thrift/trunk/lib/cocoa/src/TApplicationException.h thrift/trunk/lib/cpp/src/TApplicationException.h thrift/trunk/lib/erl/include/thrift_constants.hrl thrift/trunk/lib/hs/src/Thrift.hs thrift/trunk/lib/js/thrift.js thrift/trunk/lib/nodejs/lib/thrift/thrift.js thrift/trunk/lib/ocaml/src/Thrift.ml thrift/trunk/lib/perl/lib/Thrift.pm thrift/trunk/lib/py/src/Thrift.py thrift/trunk/lib/rb/lib/thrift/exceptions.rb Modified: thrift/trunk/lib/as3/src/org/apache/thrift/TApplicationError.as URL: http://svn.apache.org/viewvc/thrift/trunk/lib/as3/src/org/apache/thrift/TApplicationError.as?rev=1153412&r1=1153411&r2=1153412&view=diff ============================================================================== --- thrift/trunk/lib/as3/src/org/apache/thrift/TApplicationError.as (original) +++ thrift/trunk/lib/as3/src/org/apache/thrift/TApplicationError.as Wed Aug 3 09:49:27 2011 @@ -41,6 +41,7 @@ package org.apache.thrift { 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); Modified: thrift/trunk/lib/c_glib/src/thrift_application_exception.h URL: http://svn.apache.org/viewvc/thrift/trunk/lib/c_glib/src/thrift_application_exception.h?rev=1153412&r1=1153411&r2=1153412&view=diff ============================================================================== --- thrift/trunk/lib/c_glib/src/thrift_application_exception.h (original) +++ thrift/trunk/lib/c_glib/src/thrift_application_exception.h Wed Aug 3 09:49:27 2011 @@ -65,7 +65,9 @@ typedef enum 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 */ Modified: thrift/trunk/lib/cocoa/src/TApplicationException.h URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cocoa/src/TApplicationException.h?rev=1153412&r1=1153411&r2=1153412&view=diff ============================================================================== --- thrift/trunk/lib/cocoa/src/TApplicationException.h (original) +++ thrift/trunk/lib/cocoa/src/TApplicationException.h Wed Aug 3 09:49:27 2011 @@ -26,7 +26,9 @@ enum { 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 Modified: thrift/trunk/lib/cpp/src/TApplicationException.h URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/TApplicationException.h?rev=1153412&r1=1153411&r2=1153412&view=diff ============================================================================== --- thrift/trunk/lib/cpp/src/TApplicationException.h (original) +++ thrift/trunk/lib/cpp/src/TApplicationException.h Wed Aug 3 09:49:27 2011 @@ -41,7 +41,9 @@ class TApplicationException : public TEx 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() : Modified: thrift/trunk/lib/erl/include/thrift_constants.hrl URL: http://svn.apache.org/viewvc/thrift/trunk/lib/erl/include/thrift_constants.hrl?rev=1153412&r1=1153411&r2=1153412&view=diff ============================================================================== --- thrift/trunk/lib/erl/include/thrift_constants.hrl (original) +++ thrift/trunk/lib/erl/include/thrift_constants.hrl Wed Aug 3 09:49:27 2011 @@ -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). Modified: thrift/trunk/lib/hs/src/Thrift.hs URL: http://svn.apache.org/viewvc/thrift/trunk/lib/hs/src/Thrift.hs?rev=1153412&r1=1153411&r2=1153412&view=diff ============================================================================== --- thrift/trunk/lib/hs/src/Thrift.hs (original) +++ thrift/trunk/lib/hs/src/Thrift.hs Wed Aug 3 09:49:27 2011 @@ -50,6 +50,8 @@ data AppExnType | 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 @@ instance Enum AppExnType where 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 @@ instance Enum AppExnType where 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 ) Modified: thrift/trunk/lib/js/thrift.js URL: http://svn.apache.org/viewvc/thrift/trunk/lib/js/thrift.js?rev=1153412&r1=1153411&r2=1153412&view=diff ============================================================================== --- thrift/trunk/lib/js/thrift.js (original) +++ thrift/trunk/lib/js/thrift.js Wed Aug 3 09:49:27 2011 @@ -85,7 +85,9 @@ Thrift.TApplicationExceptionType = { '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) { Modified: thrift/trunk/lib/nodejs/lib/thrift/thrift.js URL: http://svn.apache.org/viewvc/thrift/trunk/lib/nodejs/lib/thrift/thrift.js?rev=1153412&r1=1153411&r2=1153412&view=diff ============================================================================== --- thrift/trunk/lib/nodejs/lib/thrift/thrift.js (original) +++ thrift/trunk/lib/nodejs/lib/thrift/thrift.js Wed Aug 3 09:49:27 2011 @@ -57,7 +57,9 @@ var TApplicationExceptionType = exports. 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) { Modified: thrift/trunk/lib/ocaml/src/Thrift.ml URL: http://svn.apache.org/viewvc/thrift/trunk/lib/ocaml/src/Thrift.ml?rev=1153412&r1=1153411&r2=1153412&view=diff ============================================================================== --- thrift/trunk/lib/ocaml/src/Thrift.ml (original) +++ thrift/trunk/lib/ocaml/src/Thrift.ml Wed Aug 3 09:49:27 2011 @@ -292,6 +292,8 @@ struct | WRONG_METHOD_NAME | BAD_SEQUENCE_ID | MISSING_RESULT + | INTERNAL_ERROR + | PROTOCOL_ERROR let typ_of_i = function 0l -> UNKNOWN @@ -300,6 +302,8 @@ struct | 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 @@ struct | WRONG_METHOD_NAME -> 3l | BAD_SEQUENCE_ID -> 4l | MISSING_RESULT -> 5l + | INTERNAL_ERROR -> 61 + | PROTOCOL_ERROR -> 71 class t = object (self) Modified: thrift/trunk/lib/perl/lib/Thrift.pm URL: http://svn.apache.org/viewvc/thrift/trunk/lib/perl/lib/Thrift.pm?rev=1153412&r1=1153411&r2=1153412&view=diff ============================================================================== --- thrift/trunk/lib/perl/lib/Thrift.pm (original) +++ thrift/trunk/lib/perl/lib/Thrift.pm Wed Aug 3 09:49:27 2011 @@ -75,6 +75,8 @@ use constant INVALID_MESSAGE_TYPE => 2; 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; Modified: thrift/trunk/lib/py/src/Thrift.py URL: http://svn.apache.org/viewvc/thrift/trunk/lib/py/src/Thrift.py?rev=1153412&r1=1153411&r2=1153412&view=diff ============================================================================== --- thrift/trunk/lib/py/src/Thrift.py (original) +++ thrift/trunk/lib/py/src/Thrift.py Wed Aug 3 09:49:27 2011 @@ -77,6 +77,8 @@ class TApplicationException(TException): 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) Modified: thrift/trunk/lib/rb/lib/thrift/exceptions.rb URL: http://svn.apache.org/viewvc/thrift/trunk/lib/rb/lib/thrift/exceptions.rb?rev=1153412&r1=1153411&r2=1153412&view=diff ============================================================================== --- thrift/trunk/lib/rb/lib/thrift/exceptions.rb (original) +++ thrift/trunk/lib/rb/lib/thrift/exceptions.rb Wed Aug 3 09:49:27 2011 @@ -35,6 +35,8 @@ module Thrift WRONG_METHOD_NAME = 3 BAD_SEQUENCE_ID = 4 MISSING_RESULT = 5 + INTERNAL_ERROR = 6 + PROTOCOL_ERROR = 7 attr_reader :type @@ -79,4 +81,4 @@ module Thrift end end -end \ No newline at end of file +end