(ctx context.Context, err error, payload proto.Message)
| 112 | } |
| 113 | |
| 114 | func encodeAsAny(ctx context.Context, err error, payload proto.Message) *types.Any { |
| 115 | if payload == nil { |
| 116 | return nil |
| 117 | } |
| 118 | |
| 119 | any, marshalErr := types.MarshalAny(payload) |
| 120 | if marshalErr != nil { |
| 121 | warningFn(ctx, |
| 122 | "error %+v (%T) announces proto message, but marshaling fails: %+v", |
| 123 | err, err, marshalErr) |
| 124 | return nil |
| 125 | } |
| 126 | |
| 127 | return any |
| 128 | } |
| 129 | |
| 130 | // encodeWrapper encodes an error wrapper. |
| 131 | func encodeWrapper(ctx context.Context, err, cause error) EncodedError { |
no outgoing calls
no test coverage detected
searching dependent graphs…