(TProtocol outputProtocol, CancellationToken cancellationToken)
| 111 | } |
| 112 | |
| 113 | public async Task WriteAsync(TProtocol outputProtocol, CancellationToken cancellationToken) |
| 114 | { |
| 115 | cancellationToken.ThrowIfCancellationRequested(); |
| 116 | |
| 117 | const string messageTypeFieldName = "message"; |
| 118 | const string exTypeFieldName = "exType"; |
| 119 | const string structApplicationExceptionName = "TApplicationException"; |
| 120 | |
| 121 | var struc = new TStruct(structApplicationExceptionName); |
| 122 | var field = new TField(); |
| 123 | |
| 124 | await outputProtocol.WriteStructBeginAsync(struc, cancellationToken); |
| 125 | |
| 126 | if (!string.IsNullOrEmpty(Message)) |
| 127 | { |
| 128 | field.Name = messageTypeFieldName; |
| 129 | field.Type = TType.String; |
| 130 | field.ID = MessageTypeFieldId; |
| 131 | await outputProtocol.WriteFieldBeginAsync(field, cancellationToken); |
| 132 | await outputProtocol.WriteStringAsync(Message, cancellationToken); |
| 133 | await outputProtocol.WriteFieldEndAsync(cancellationToken); |
| 134 | } |
| 135 | |
| 136 | field.Name = exTypeFieldName; |
| 137 | field.Type = TType.I32; |
| 138 | field.ID = ExTypeFieldId; |
| 139 | |
| 140 | await outputProtocol.WriteFieldBeginAsync(field, cancellationToken); |
| 141 | await outputProtocol.WriteI32Async((int) Type, cancellationToken); |
| 142 | await outputProtocol.WriteFieldEndAsync(cancellationToken); |
| 143 | await outputProtocol.WriteFieldStopAsync(cancellationToken); |
| 144 | await outputProtocol.WriteStructEndAsync(cancellationToken); |
| 145 | } |
| 146 | } |
| 147 | } |
nothing calls this directly
no test coverage detected