(TProtocol inputProtocol, CancellationToken cancellationToken)
| 62 | } |
| 63 | |
| 64 | public static async ValueTask<TApplicationException> ReadAsync(TProtocol inputProtocol, CancellationToken cancellationToken) |
| 65 | { |
| 66 | string message = null; |
| 67 | var type = ExceptionType.Unknown; |
| 68 | |
| 69 | await inputProtocol.ReadStructBeginAsync(cancellationToken); |
| 70 | while (true) |
| 71 | { |
| 72 | var field = await inputProtocol.ReadFieldBeginAsync(cancellationToken); |
| 73 | if (field.Type == TType.Stop) |
| 74 | { |
| 75 | break; |
| 76 | } |
| 77 | |
| 78 | switch (field.ID) |
| 79 | { |
| 80 | case MessageTypeFieldId: |
| 81 | if (field.Type == TType.String) |
| 82 | { |
| 83 | message = await inputProtocol.ReadStringAsync(cancellationToken); |
| 84 | } |
| 85 | else |
| 86 | { |
| 87 | await TProtocolUtil.SkipAsync(inputProtocol, field.Type, cancellationToken); |
| 88 | } |
| 89 | break; |
| 90 | case ExTypeFieldId: |
| 91 | if (field.Type == TType.I32) |
| 92 | { |
| 93 | type = (ExceptionType) await inputProtocol.ReadI32Async(cancellationToken); |
| 94 | } |
| 95 | else |
| 96 | { |
| 97 | await TProtocolUtil.SkipAsync(inputProtocol, field.Type, cancellationToken); |
| 98 | } |
| 99 | break; |
| 100 | default: |
| 101 | await TProtocolUtil.SkipAsync(inputProtocol, field.Type, cancellationToken); |
| 102 | break; |
| 103 | } |
| 104 | |
| 105 | await inputProtocol.ReadFieldEndAsync(cancellationToken); |
| 106 | } |
| 107 | |
| 108 | await inputProtocol.ReadStructEndAsync(cancellationToken); |
| 109 | |
| 110 | return new TApplicationException(type, message); |
| 111 | } |
| 112 | |
| 113 | public async Task WriteAsync(TProtocol outputProtocol, CancellationToken cancellationToken) |
| 114 | { |
nothing calls this directly
no test coverage detected