Skip to content
Permalink
Browse files
增加一个自定义的异常,用于jsonrpc传递服务端的异常。
code为-32000,需要服务端的框架修改配合
  • Loading branch information
JoeCao committed Feb 25, 2016
1 parent b6c23f9 commit 8b86353ec310c09ccf907126270cf55825820115
Showing 1 changed file with 9 additions and 0 deletions.
@@ -80,9 +80,18 @@ def __init__(self, message=None, data=None):
DubboClientError.__init__(self, message=message, data=data)


class UserDefinedError(DubboClientError):
code = -32000
message = u'User defined error happend'

def __init__(self, message=None, data=None):
DubboClientError.__init__(self, message=message, data=data)


dubbo_client_errors[MethodNotFound.code] = MethodNotFound
dubbo_client_errors[NoProvider.code] = NoProvider
dubbo_client_errors[ConnectionFail.code] = ConnectionFail
dubbo_client_errors[InvalidParams.code] = InvalidParams
dubbo_client_errors[InternalError.code] = InternalError
dubbo_client_errors[InvalidRequest.code] = InvalidRequest
dubbo_client_errors[UserDefinedError.code] = UserDefinedError

0 comments on commit 8b86353

Please sign in to comment.