Permalink
Browse files

THRIFT-690 add new ApplicationExceptions (INTERNAL_ERROR, PROTOCOL_ER…

…ROR) 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
  • Loading branch information...
bufferoverflow committed Aug 3, 2011
1 parent c190558 commit 345ecc739ab145f9a0e7c27bbcb4ee72ccd3a86b
@@ -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);
@@ -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 */
@@ -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
@@ -41,7 +41,9 @@ class TApplicationException : public TException {
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() :
@@ -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).
View
@@ -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 )
View
@@ -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) {
@@ -57,7 +57,9 @@ var TApplicationExceptionType = exports.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
}
var TApplicationException = exports.TApplicationException = function(type, message) {
View
@@ -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)
View
@@ -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;
View
@@ -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)
@@ -35,6 +35,8 @@ class ApplicationException < Exception
WRONG_METHOD_NAME = 3
BAD_SEQUENCE_ID = 4
MISSING_RESULT = 5
+ INTERNAL_ERROR = 6
+ PROTOCOL_ERROR = 7
attr_reader :type
@@ -79,4 +81,4 @@ def write(oprot)
end
end
-end
+end

0 comments on commit 345ecc7

Please sign in to comment.