(t *testing.T)
| 48 | } |
| 49 | |
| 50 | func TestServerError_CustomPrinter(t *testing.T) { |
| 51 | testError := &Error{ |
| 52 | err: errors.New("err"), |
| 53 | msg: "foo", |
| 54 | code: codes.Aborted, |
| 55 | Printer: testPrinter{}, |
| 56 | } |
| 57 | status := testError.GRPCStatus() |
| 58 | assert.Equal(t, codes.Aborted, status.Code()) |
| 59 | assert.Equal(t, "FOO", status.Message()) |
| 60 | bytes, err := testError.MarshalJSON() |
| 61 | assert.NoError(t, err) |
| 62 | assert.Equal(t, []byte(`{"code":10,"message":"FOO"}`), bytes) |
| 63 | } |
| 64 | |
| 65 | func TestWrap(t *testing.T) { |
| 66 | type args struct { |
nothing calls this directly
no test coverage detected