本文整理汇总了Golang中git/apache/org/thrift/git/lib/go/thrift.NewTApplicationException函数的典型用法代码示例。如果您正苦于以下问题:Golang NewTApplicationException函数的具体用法?Golang NewTApplicationException怎么用?Golang NewTApplicationException使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NewTApplicationException函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: recvAppendBatch
func (p *ThriftSourceProtocolClient) recvAppendBatch() (value Status, err error) {
iprot := p.InputProtocol
if iprot == nil {
iprot = p.ProtocolFactory.GetProtocol(p.Transport)
p.InputProtocol = iprot
}
_, mTypeId, seqId, err := iprot.ReadMessageBegin()
if err != nil {
return
}
if mTypeId == thrift.EXCEPTION {
error8 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception")
var error9 error
error9, err = error8.Read(iprot)
if err != nil {
return
}
if err = iprot.ReadMessageEnd(); err != nil {
return
}
err = error9
return
}
if p.SeqId != seqId {
err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "ping failed: out of sequence response")
return
}
result7 := NewAppendBatchResult()
err = result7.Read(iprot)
iprot.ReadMessageEnd()
value = result7.Success
return
}
开发者ID:rejoicelee,项目名称:flume-log-sdk,代码行数:33,代码来源:thrift_source_protocol.go
示例2: recvCandify
func (p *CandyClient) recvCandify() (value *Result, err error) {
iprot := p.InputProtocol
if iprot == nil {
iprot = p.ProtocolFactory.GetProtocol(p.Transport)
p.InputProtocol = iprot
}
_, mTypeId, seqId, err := iprot.ReadMessageBegin()
if err != nil {
return
}
if mTypeId == thrift.EXCEPTION {
error7 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception")
var error8 error
error8, err = error7.Read(iprot)
if err != nil {
return
}
if err = iprot.ReadMessageEnd(); err != nil {
return
}
err = error8
return
}
if p.SeqId != seqId {
err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "ping failed: out of sequence response")
return
}
result6 := NewCandifyResult()
err = result6.Read(iprot)
iprot.ReadMessageEnd()
value = result6.Success
return
}
开发者ID:improvemedia,项目名称:colorcandy,代码行数:33,代码来源:candy.go
示例3: recvGetId
func (p *SnowflakeClient) recvGetId() (value int64, err error) {
iprot := p.InputProtocol
if iprot == nil {
iprot = p.ProtocolFactory.GetProtocol(p.Transport)
p.InputProtocol = iprot
}
_, mTypeId, seqId, err := iprot.ReadMessageBegin()
if err != nil {
return
}
if mTypeId == thrift.EXCEPTION {
error10 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception")
var error11 error
error11, err = error10.Read(iprot)
if err != nil {
return
}
if err = iprot.ReadMessageEnd(); err != nil {
return
}
err = error11
return
}
if p.SeqId != seqId {
err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "ping failed: out of sequence response")
return
}
result9 := NewGetIdResult()
err = result9.Read(iprot)
iprot.ReadMessageEnd()
value = result9.Success
return
}
开发者ID:vonwenm,项目名称:gosnowflake-1,代码行数:33,代码来源:snowflake.go
示例4: recvFunCall
func (p *PushServiceClient) recvFunCall() (value []string, err error) {
iprot := p.InputProtocol
if iprot == nil {
iprot = p.ProtocolFactory.GetProtocol(p.Transport)
p.InputProtocol = iprot
}
_, mTypeId, seqId, err := iprot.ReadMessageBegin()
if err != nil {
return
}
if mTypeId == thrift.EXCEPTION {
error2 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception")
var error3 error
error3, err = error2.Read(iprot)
if err != nil {
return
}
if err = iprot.ReadMessageEnd(); err != nil {
return
}
err = error3
return
}
if p.SeqId != seqId {
err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "ping failed: out of sequence response")
return
}
result1 := NewFunCallResult()
err = result1.Read(iprot)
iprot.ReadMessageEnd()
value = result1.Success
return
}
开发者ID:citysir,项目名称:zpush,代码行数:33,代码来源:push_service.go
示例5: recvUpdateStatus
func (p *CommonServiceClient) recvUpdateStatus() (value bool, err error) {
iprot := p.InputProtocol
if iprot == nil {
iprot = p.ProtocolFactory.GetProtocol(p.Transport)
p.InputProtocol = iprot
}
_, mTypeId, seqId, err := iprot.ReadMessageBegin()
if err != nil {
return
}
if mTypeId == thrift.EXCEPTION {
error14 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception")
var error15 error
error15, err = error14.Read(iprot)
if err != nil {
return
}
if err = iprot.ReadMessageEnd(); err != nil {
return
}
err = error15
return
}
if p.SeqId != seqId {
err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "ping failed: out of sequence response")
return
}
result13 := NewUpdateStatusResult()
err = result13.Read(iprot)
iprot.ReadMessageEnd()
value = result13.Success
return
}
开发者ID:huacnlee,项目名称:thrift_example,代码行数:33,代码来源:common_service.go
示例6: recvCompact
func (p *C4AdminClient) recvCompact() (err error) {
iprot := p.InputProtocol
if iprot == nil {
iprot = p.ProtocolFactory.GetProtocol(p.Transport)
p.InputProtocol = iprot
}
_, mTypeId, seqId, err := iprot.ReadMessageBegin()
if err != nil {
return
}
if mTypeId == thrift.EXCEPTION {
error29 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception")
var error30 error
error30, err = error29.Read(iprot)
if err != nil {
return
}
if err = iprot.ReadMessageEnd(); err != nil {
return
}
err = error30
return
}
if p.SeqId != seqId {
err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "ping failed: out of sequence response")
return
}
result28 := NewCompactResult()
err = result28.Read(iprot)
iprot.ReadMessageEnd()
return
}
开发者ID:cosh,项目名称:C4,代码行数:32,代码来源:c4_admin.go
示例7: recvLoad
func (p *C4AdminClient) recvLoad() (ire *InvalidRequestException, err error) {
iprot := p.InputProtocol
if iprot == nil {
iprot = p.ProtocolFactory.GetProtocol(p.Transport)
p.InputProtocol = iprot
}
_, mTypeId, seqId, err := iprot.ReadMessageBegin()
if err != nil {
return
}
if mTypeId == thrift.EXCEPTION {
error41 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception")
var error42 error
error42, err = error41.Read(iprot)
if err != nil {
return
}
if err = iprot.ReadMessageEnd(); err != nil {
return
}
err = error42
return
}
if p.SeqId != seqId {
err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "ping failed: out of sequence response")
return
}
result40 := NewLoadResult()
err = result40.Read(iprot)
iprot.ReadMessageEnd()
if result40.Ire != nil {
ire = result40.Ire
}
return
}
开发者ID:cosh,项目名称:C4,代码行数:35,代码来源:c4_admin.go
示例8: recvCalculate
func (p *CalculatorClient) recvCalculate() (value int32, err error) {
iprot := p.InputProtocol
if iprot == nil {
iprot = p.ProtocolFactory.GetProtocol(p.Transport)
p.InputProtocol = iprot
}
method, mTypeId, seqId, err := iprot.ReadMessageBegin()
if err != nil {
return
}
if method != "calculate" {
err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "calculate failed: wrong method name")
return
}
if p.SeqId != seqId {
err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "calculate failed: out of sequence response")
return
}
if mTypeId == thrift.EXCEPTION {
error4 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception")
var error5 error
error5, err = error4.Read(iprot)
if err != nil {
return
}
if err = iprot.ReadMessageEnd(); err != nil {
return
}
err = error5
return
}
if mTypeId != thrift.REPLY {
err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "calculate failed: invalid message type")
return
}
result := CalculatorCalculateResult{}
if err = result.Read(iprot); err != nil {
return
}
if err = iprot.ReadMessageEnd(); err != nil {
return
}
if result.Ouch != nil {
err = result.Ouch
return
}
value = result.GetSuccess()
return
}
开发者ID:glycerine,项目名称:golang-thrift-minimal-example,代码行数:49,代码来源:calculator.go
示例9: Process
func (p *calculatorProcessorCalculate) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
args := CalculateArgs{}
if err = args.Read(iprot); err != nil {
iprot.ReadMessageEnd()
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
oprot.WriteMessageBegin("calculate", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return false, err
}
iprot.ReadMessageEnd()
result := CalculateResult{}
var retval int32
var err2 error
if retval, err2 = p.handler.Calculate(args.Logid, args.W); err2 != nil {
switch v := err2.(type) {
case *InvalidOperation:
result.Ouch = v
default:
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing calculate: "+err2.Error())
oprot.WriteMessageBegin("calculate", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return true, err2
}
} else {
result.Success = &retval
}
if err2 = oprot.WriteMessageBegin("calculate", thrift.REPLY, seqId); err2 != nil {
err = err2
}
if err2 = result.Write(oprot); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.Flush(); err == nil && err2 != nil {
err = err2
}
if err != nil {
return
}
return true, err
}
开发者ID:Workiva,项目名称:thrift-nats,代码行数:48,代码来源:calculator.go
示例10: Process
func (p *liveManagerProcessorSendLiveMessage) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
args := SendLiveMessageArgs{}
if err = args.Read(iprot); err != nil {
iprot.ReadMessageEnd()
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
oprot.WriteMessageBegin("sendLiveMessage", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return false, err
}
iprot.ReadMessageEnd()
result := SendLiveMessageResult{}
var retval int64
var err2 error
if retval, err2 = p.handler.SendLiveMessage(args.Rid, args.Uid, args.Comment, args.FromInfo); err2 != nil {
switch v := err2.(type) {
case *entity.UdsException:
result.E = v
default:
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing sendLiveMessage: "+err2.Error())
oprot.WriteMessageBegin("sendLiveMessage", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return true, err2
}
} else {
result.Success = &retval
}
if err2 = oprot.WriteMessageBegin("sendLiveMessage", thrift.REPLY, seqId); err2 != nil {
err = err2
}
if err2 = result.Write(oprot); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.Flush(); err == nil && err2 != nil {
err = err2
}
if err != nil {
return
}
return true, err
}
开发者ID:lei-yu,项目名称:GOPATH,代码行数:48,代码来源:livemanager.go
示例11: Process
func (p *privateMessageManagerSyncProcessorGetPrivateMessageList) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
args := GetPrivateMessageListArgs{}
if err = args.Read(iprot); err != nil {
iprot.ReadMessageEnd()
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
oprot.WriteMessageBegin("getPrivateMessageList", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return false, err
}
iprot.ReadMessageEnd()
result := GetPrivateMessageListResult{}
var retval []*entity.PrivateMessageResult_
var err2 error
if retval, err2 = p.handler.GetPrivateMessageList(args.Uid, args.StartReceiveTime, args.EndReceiveTime, args.StartId, args.IsReversed, args.RowCount); err2 != nil {
switch v := err2.(type) {
case *entity.UdsException:
result.E = v
default:
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getPrivateMessageList: "+err2.Error())
oprot.WriteMessageBegin("getPrivateMessageList", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return true, err2
}
} else {
result.Success = retval
}
if err2 = oprot.WriteMessageBegin("getPrivateMessageList", thrift.REPLY, seqId); err2 != nil {
err = err2
}
if err2 = result.Write(oprot); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.Flush(); err == nil && err2 != nil {
err = err2
}
if err != nil {
return
}
return true, err
}
开发者ID:lei-yu,项目名称:GOPATH,代码行数:48,代码来源:privatemessagemanagersync.go
示例12: Process
func (p *computationServiceProcessorBoltMetadata) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
args := BoltMetadataArgs{}
if err = args.Read(iprot); err != nil {
iprot.ReadMessageEnd()
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
oprot.WriteMessageBegin("boltMetadata", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return false, err
}
iprot.ReadMessageEnd()
result := BoltMetadataResult{}
var retval *ComputationMetadata
var err2 error
if retval, err2 = p.handler.BoltMetadata(); err2 != nil {
switch v := err2.(type) {
case *BoltError:
result.E = v
default:
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing boltMetadata: "+err2.Error())
oprot.WriteMessageBegin("boltMetadata", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return true, err2
}
} else {
result.Success = retval
}
if err2 = oprot.WriteMessageBegin("boltMetadata", thrift.REPLY, seqId); err2 != nil {
err = err2
}
if err2 = result.Write(oprot); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.Flush(); err == nil && err2 != nil {
err = err2
}
if err != nil {
return
}
return true, err
}
开发者ID:concord,项目名称:concord-go,代码行数:48,代码来源:computationservice.go
示例13: Process
func (p *friendManagerSyncProcessorGetFriends) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
args := GetFriendsArgs{}
if err = args.Read(iprot); err != nil {
iprot.ReadMessageEnd()
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
oprot.WriteMessageBegin("getFriends", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return false, err
}
iprot.ReadMessageEnd()
result := GetFriendsResult{}
var retval []*entity.Friend
var err2 error
if retval, err2 = p.handler.GetFriends(args.Uid); err2 != nil {
switch v := err2.(type) {
case *entity.UdsException:
result.E = v
default:
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getFriends: "+err2.Error())
oprot.WriteMessageBegin("getFriends", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return true, err2
}
} else {
result.Success = retval
}
if err2 = oprot.WriteMessageBegin("getFriends", thrift.REPLY, seqId); err2 != nil {
err = err2
}
if err2 = result.Write(oprot); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.Flush(); err == nil && err2 != nil {
err = err2
}
if err != nil {
return
}
return true, err
}
开发者ID:lei-yu,项目名称:GOPATH,代码行数:48,代码来源:friendmanagersync.go
示例14: Process
func (p *mutableEphemeralStateServiceProcessorGetState) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
args := GetStateArgs{}
if err = args.Read(iprot); err != nil {
iprot.ReadMessageEnd()
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
oprot.WriteMessageBegin("getState", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return false, err
}
iprot.ReadMessageEnd()
result := GetStateResult{}
var retval []byte
var err2 error
if retval, err2 = p.handler.GetState(args.Key); err2 != nil {
switch v := err2.(type) {
case *BoltError:
result.E = v
default:
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getState: "+err2.Error())
oprot.WriteMessageBegin("getState", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return true, err2
}
} else {
result.Success = retval
}
if err2 = oprot.WriteMessageBegin("getState", thrift.REPLY, seqId); err2 != nil {
err = err2
}
if err2 = result.Write(oprot); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.Flush(); err == nil && err2 != nil {
err = err2
}
if err != nil {
return
}
return true, err
}
开发者ID:concord,项目名称:concord-go,代码行数:48,代码来源:mutableephemeralstateservice.go
示例15: Process
func (p *tagManagerProcessorGetTagsByUid) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
args := GetTagsByUidArgs{}
if err = args.Read(iprot); err != nil {
iprot.ReadMessageEnd()
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
oprot.WriteMessageBegin("getTagsByUid", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return false, err
}
iprot.ReadMessageEnd()
result := GetTagsByUidResult{}
var err2 error
if err2 = p.handler.GetTagsByUid(args.Uid, args.StartRid, args.RowCount, args.FromInfo); err2 != nil {
switch v := err2.(type) {
case *entity.UdsException:
result.E = v
default:
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getTagsByUid: "+err2.Error())
oprot.WriteMessageBegin("getTagsByUid", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return true, err2
}
}
if err2 = oprot.WriteMessageBegin("getTagsByUid", thrift.REPLY, seqId); err2 != nil {
err = err2
}
if err2 = result.Write(oprot); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.Flush(); err == nil && err2 != nil {
err = err2
}
if err != nil {
return
}
return true, err
}
开发者ID:lei-yu,项目名称:GOPATH,代码行数:45,代码来源:tagmanager.go
示例16: Process
func (p *boltManagerServiceProcessorSignal) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
args := SignalArgs{}
if err = args.Read(iprot); err != nil {
iprot.ReadMessageEnd()
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
oprot.WriteMessageBegin("signal", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return false, err
}
iprot.ReadMessageEnd()
result := SignalResult{}
var err2 error
if err2 = p.handler.Signal(args.TopologyId, args.S); err2 != nil {
switch v := err2.(type) {
case *BoltError:
result.E = v
default:
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing signal: "+err2.Error())
oprot.WriteMessageBegin("signal", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return true, err2
}
}
if err2 = oprot.WriteMessageBegin("signal", thrift.REPLY, seqId); err2 != nil {
err = err2
}
if err2 = result.Write(oprot); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.Flush(); err == nil && err2 != nil {
err = err2
}
if err != nil {
return
}
return true, err
}
开发者ID:concord,项目名称:concord-go,代码行数:45,代码来源:boltmanagerservice.go
示例17: Process
func (p *inviteCodeManagerProcessorUseInviteCode) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
args := UseInviteCodeArgs{}
if err = args.Read(iprot); err != nil {
iprot.ReadMessageEnd()
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
oprot.WriteMessageBegin("useInviteCode", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return false, err
}
iprot.ReadMessageEnd()
result := UseInviteCodeResult{}
var err2 error
if err2 = p.handler.UseInviteCode(args.Code, args.FromType, args.FromInfo); err2 != nil {
switch v := err2.(type) {
case *entity.UdsException:
result.E = v
default:
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing useInviteCode: "+err2.Error())
oprot.WriteMessageBegin("useInviteCode", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return true, err2
}
}
if err2 = oprot.WriteMessageBegin("useInviteCode", thrift.REPLY, seqId); err2 != nil {
err = err2
}
if err2 = result.Write(oprot); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.Flush(); err == nil && err2 != nil {
err = err2
}
if err != nil {
return
}
return true, err
}
开发者ID:lei-yu,项目名称:GOPATH,代码行数:45,代码来源:invitecodemanager.go
示例18: recvGetStruct
func (p *SharedServiceClient) recvGetStruct() (value *SharedStruct, err error) {
iprot := p.InputProtocol
if iprot == nil {
iprot = p.ProtocolFactory.GetProtocol(p.Transport)
p.InputProtocol = iprot
}
method, mTypeId, seqId, err := iprot.ReadMessageBegin()
if err != nil {
return
}
if method != "getStruct" {
err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "getStruct failed: wrong method name")
return
}
if p.SeqId != seqId {
err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getStruct failed: out of sequence response")
return
}
if mTypeId == thrift.EXCEPTION {
error0 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception")
var error1 error
error1, err = error0.Read(iprot)
if err != nil {
return
}
if err = iprot.ReadMessageEnd(); err != nil {
return
}
err = error1
return
}
if mTypeId != thrift.REPLY {
err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getStruct failed: invalid message type")
return
}
result := SharedServiceGetStructResult{}
if err = result.Read(iprot); err != nil {
return
}
if err = iprot.ReadMessageEnd(); err != nil {
return
}
value = result.GetSuccess()
return
}
开发者ID:glycerine,项目名称:golang-thrift-minimal-example,代码行数:45,代码来源:sharedservice.go
示例19: Process
func (p *boltProxyServiceProcessorUpdateSchedulerAddress) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
args := UpdateSchedulerAddressArgs{}
if err = args.Read(iprot); err != nil {
iprot.ReadMessageEnd()
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
oprot.WriteMessageBegin("updateSchedulerAddress", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return false, err
}
iprot.ReadMessageEnd()
result := UpdateSchedulerAddressResult{}
var err2 error
if err2 = p.handler.UpdateSchedulerAddress(args.E); err2 != nil {
switch v := err2.(type) {
case *BoltError:
result.E = v
default:
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing updateSchedulerAddress: "+err2.Error())
oprot.WriteMessageBegin("updateSchedulerAddress", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return true, err2
}
}
if err2 = oprot.WriteMessageBegin("updateSchedulerAddress", thrift.REPLY, seqId); err2 != nil {
err = err2
}
if err2 = result.Write(oprot); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.Flush(); err == nil && err2 != nil {
err = err2
}
if err != nil {
return
}
return true, err
}
开发者ID:concord,项目名称:concord-go,代码行数:45,代码来源:boltproxyservice.go
示例20: Process
func (p *statusManagerSyncProcessorUpdateStatus) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
args := UpdateStatusArgs{}
if err = args.Read(iprot); err != nil {
iprot.ReadMessageEnd()
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
oprot.WriteMessageBegin("updateStatus", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return false, err
}
iprot.ReadMessageEnd()
result := UpdateStatusResult{}
var err2 error
if err2 = p.handler.UpdateStatus(args.Key, args.StatusType, args.UpdateType); err2 != nil {
switch v := err2.(type) {
case *entity.UdsException:
result.E = v
default:
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing updateStatus: "+err2.Error())
oprot.WriteMessageBegin("updateStatus", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush()
return true, err2
}
}
if err2 = oprot.WriteMessageBegin("updateStatus", thrift.REPLY, seqId); err2 != nil {
err = err2
}
if err2 = result.Write(oprot); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.Flush(); err == nil && err2 != nil {
err = err2
}
if err != nil {
return
}
return true, err
}
开发者ID:lei-yu,项目名称:GOPATH,代码行数:45,代码来源:statusmanagersync.go
注:本文中的git/apache/org/thrift/git/lib/go/thrift.NewTApplicationException函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论