From f44a438a2261ecc8e0542cff487f324226c7c9c3 Mon Sep 17 00:00:00 2001 From: wildlifehexagon Date: Thu, 23 Jan 2020 16:49:09 -0600 Subject: [PATCH] feat: add json encoding error helper function --- error.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/error.go b/error.go index e242bb2..650f6b0 100644 --- a/error.go +++ b/error.go @@ -192,4 +192,9 @@ func HandleOauthExchangeError(ctx context.Context, err error) error { func HandleUserRetrievalError(ctx context.Context, err error) error { grpc.SetTrailer(ctx, ErrUserRetrieval) return status.Error(codes.Internal, err.Error()) -} \ No newline at end of file +} + +func HandleJSONEncodingError(ctx context.Context, err error) error { + grpc.SetTrailer(ctx, ErrJSONEncoding) + return status.Error(codes.Internal, err.Error()) +}