private void Fail( TProtocol oprot, TMessage message, TApplicationException.ExceptionType extype, string etxt) { TApplicationException appex = new TApplicationException( extype, etxt); TMessage newMessage = new TMessage(message.Name, TMessageType.Exception, message.SeqID); oprot.WriteMessageBegin(newMessage); appex.Write( oprot); oprot.WriteMessageEnd(); oprot.Transport.Flush(); }
public List <PositionViewEntity> recv_getAllPositionInfo() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } getAllPositionInfo_result result = new getAllPositionInfo_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.success) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getAllPositionInfo failed: unknown result"); }
public static TApplicationException CreateAndWriteApplicationException(TProtocol outProtocol, IRequestContext requestContext, string methodName, int sequenceId, TApplicationException.ExceptionType exceptionType, string message, AggregateException cause, ILogger logger) { // unexpected exception String error = message; if (cause != null) { error = String.Concat(error, $"{Environment.NewLine}{cause.ToString()}"); } TApplicationException applicationException = new TApplicationException(exceptionType, error); return(WriteApplicationException(outProtocol, requestContext, methodName, sequenceId, applicationException, logger)); }
public int recv_Add() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } Add_result result = new Add_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.success) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "Add failed: unknown result"); }
public List <Feature> recv_getFeaturesInRect() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } getFeaturesInRect_result result = new getFeaturesInRect_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.success) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getFeaturesInRect failed: unknown result"); }
public void recv_notify() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } notify_result result = new notify_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.e) { throw result.E; } return; }
public List <BookInfo> recv_GetAllBooks() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } GetAllBooks_result result = new GetAllBooks_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.success) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "GetAllBooks failed: unknown result"); }
public Ruyi.SDK.Speech.SpeechResult recv_Say() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } Say_result result = new Say_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.success) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "Say failed: unknown result"); }
public List <LogEntry> recv_getMessages() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } getMessages_result result = new getMessages_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.Success != null) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getMessages failed: unknown result"); }
public void recv_addUser() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } addUser_result result = new addUser_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.err) { throw result.Err; } return; }
public ResultCode recv_Log() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } Log_result result = new Log_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.Success.HasValue) { return(result.Success.Value); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "Log failed: unknown result"); }
public Status recv_appendBatch() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } appendBatch_result result = new appendBatch_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.success) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "appendBatch failed: unknown result"); }
public sbyte recv_OfflineQues() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } OfflineQues_result result = new OfflineQues_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.success) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "OfflineQues failed: unknown result"); }
public string recv_getLocationInfoIncremental() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } getLocationInfoIncremental_result result = new getLocationInfoIncremental_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.success) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getLocationInfoIncremental failed: unknown result"); }
public MMIStandard.MAvatarPostureValues recv_Blend() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } Blend_result result = new Blend_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.success) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "Blend failed: unknown result"); }
public List <Question> recv_QueryQuestions() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } QueryQuestions_result result = new QueryQuestions_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.success) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "QueryQuestions failed: unknown result"); }
public MMIStandard.MBoolResponse recv_SetBlendingMask() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } SetBlendingMask_result result = new SetBlendingMask_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.success) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "SetBlendingMask failed: unknown result"); }
public TicketStatusDTO recv_cancelTicketExecution() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } cancelTicketExecution_result result = new cancelTicketExecution_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.success) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "cancelTicketExecution failed: unknown result"); }
public SendResponse_0 recv_sendSync_0() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } sendSync_0_result result = new sendSync_0_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.success) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "sendSync_0 failed: unknown result"); }
public bool recv_deleteFeature() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } deleteFeature_result result = new deleteFeature_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.success) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "deleteFeature failed: unknown result"); }
public List <string> recv_testCase2() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } testCase2_result result = new testCase2_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.success) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "testCase2 failed: unknown result"); }
public AuthResponse recv_authenticate() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } authenticate_result result = new authenticate_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.success) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "authenticate failed: unknown result"); }
public string recv_GetRecipeData() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } GetRecipeData_result result = new GetRecipeData_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.success) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "GetRecipeData failed: unknown result"); }
public Dictionary <int, Customer> recv_GetMap() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } GetMap_result result = new GetMap_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.success) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "GetMap failed: unknown result"); }
public Ruyi.SDK.StorageLayer.GetLocalPathResult recv_GetLocalPath() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } GetLocalPath_result result = new GetLocalPath_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.success) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "GetLocalPath failed: unknown result"); }
public byte[] recv_Revert() { TMessage msg = this.iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(this.iprot_); this.iprot_.ReadMessageEnd(); throw x; } Revert_result result = new Revert_result(); result.Read(this.iprot_); this.iprot_.ReadMessageEnd(); if (result.__isset.success) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "Revert failed: unknown result"); }
public async Task <SpotPhoneNumberResponse> lookupByPhoneNumberAsync(string countryAreaCode, string phoneNumber, CancellationToken cancellationToken) { await OutputProtocol.WriteMessageBeginAsync(new TMessage("lookupByPhoneNumber", TMessageType.Call, SeqId), cancellationToken); var args = new lookupByPhoneNumberArgs(); args.CountryAreaCode = countryAreaCode; args.PhoneNumber = phoneNumber; await args.WriteAsync(OutputProtocol, cancellationToken); await OutputProtocol.WriteMessageEndAsync(cancellationToken); await OutputProtocol.Transport.FlushAsync(cancellationToken); var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken); if (msg.Type == TMessageType.Exception) { var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); throw x; } var result = new lookupByPhoneNumberResult(); await result.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); if (result.__isset.success) { return(result.Success); } if (result.__isset.e) { throw result.E; } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "lookupByPhoneNumber failed: unknown result"); }
public async global::System.Threading.Tasks.Task submitBatches_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken) { var args = new InternalStructs.submitBatchesArgs(); await args.ReadAsync(iprot, cancellationToken); await iprot.ReadMessageEndAsync(cancellationToken); var result = new InternalStructs.submitBatchesResult(); try { result.Success = await _iAsync.submitBatchesAsync(args.Batches, cancellationToken); await oprot.WriteMessageBeginAsync(new TMessage("submitBatches", TMessageType.Reply, seqid), cancellationToken); await result.WriteAsync(oprot, cancellationToken); } catch (TTransportException) { throw; } catch (Exception ex) { var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}"; if (_logger != null) { _logger.LogError(ex, sErr); } else { Console.Error.WriteLine(sErr); } var x = new TApplicationException(TApplicationException.ExceptionType.InternalError, " Internal error."); await oprot.WriteMessageBeginAsync(new TMessage("submitBatches", TMessageType.Exception, seqid), cancellationToken); await x.WriteAsync(oprot, cancellationToken); } await oprot.WriteMessageEndAsync(cancellationToken); await oprot.Transport.FlushAsync(cancellationToken); }
public async Task <SnsProfile> getSnsMyProfileAsync(SnsIdType snsIdType, string snsAccessToken, CancellationToken cancellationToken) { await OutputProtocol.WriteMessageBeginAsync(new TMessage("getSnsMyProfile", TMessageType.Call, SeqId), cancellationToken); var args = new getSnsMyProfileArgs(); args.SnsIdType = snsIdType; args.SnsAccessToken = snsAccessToken; await args.WriteAsync(OutputProtocol, cancellationToken); await OutputProtocol.WriteMessageEndAsync(cancellationToken); await OutputProtocol.Transport.FlushAsync(cancellationToken); var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken); if (msg.Type == TMessageType.Exception) { var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); throw x; } var result = new getSnsMyProfileResult(); await result.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); if (result.__isset.success) { return(result.Success); } if (result.__isset.e) { throw result.E; } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getSnsMyProfile failed: unknown result"); }
public async Task <int> calculateAsync(int logid, Work w, CancellationToken cancellationToken) { await OutputProtocol.WriteMessageBeginAsync(new TMessage("calculate", TMessageType.Call, SeqId), cancellationToken); var args = new calculateArgs(); args.Logid = logid; args.W = w; await args.WriteAsync(OutputProtocol, cancellationToken); await OutputProtocol.WriteMessageEndAsync(cancellationToken); await OutputProtocol.Transport.FlushAsync(cancellationToken); var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken); if (msg.Type == TMessageType.Exception) { var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); throw x; } var result = new calculateResult(); await result.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); if (result.__isset.success) { return(result.Success); } if (result.__isset.ouch) { throw result.Ouch; } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "calculate failed: unknown result"); }
public async global::System.Threading.Tasks.Task <global::APIGateway.Thrift.Generated.NotificationTypes.NotificationQueueResponse> SendNotificationAsync(global::APIGateway.Thrift.Generated.NotificationTypes.NotificationQueueRequest queueRequest, CancellationToken cancellationToken = default) { await OutputProtocol.WriteMessageBeginAsync(new TMessage("SendNotification", TMessageType.Call, SeqId), cancellationToken); var args = new InternalStructs.SendNotificationArgs() { QueueRequest = queueRequest, }; await args.WriteAsync(OutputProtocol, cancellationToken); await OutputProtocol.WriteMessageEndAsync(cancellationToken); await OutputProtocol.Transport.FlushAsync(cancellationToken); var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken); if (msg.Type == TMessageType.Exception) { var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); throw x; } var result = new InternalStructs.SendNotificationResult(); await result.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); if (result.__isset.success) { return(result.Success); } if (result.__isset.ne) { throw result.Ne; } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "SendNotification failed: unknown result"); }
public bool Process(TProtocol iprot, TProtocol oprot) { try { TMessage msg = iprot.ReadMessageBegin(); ProcessFunction fn; this.processMap_.TryGetValue(msg.Name, out fn); if (fn == null) { TProtocolUtil.Skip(iprot, TType.Struct); iprot.ReadMessageEnd(); var x = new TApplicationException(TApplicationException.ExceptionType.UnknownMethod, "Invalid method name: '" + msg.Name + "'"); oprot.WriteMessageBegin(new TMessage(msg.Name, TMessageType.Exception, msg.SeqID)); x.Write(oprot); oprot.WriteMessageEnd(); oprot.Transport.Flush(); return true; } fn(msg.SeqID, iprot, oprot); } catch (IOException) { return false; } return true; }