Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update panic error handling in containers #173

Merged
merged 10 commits into from
Feb 4, 2025
6 changes: 3 additions & 3 deletions pkg/sourcetransformer/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ outer:
if err := grp.Wait(); err != nil {
log.Printf("Stopping the SourceTransformFn with err, %s", err)
fs.shutdownCh <- struct{}{}
return status.Errorf(codes.Internal, err.Error())
return status.Errorf(codes.Internal, "%s", err.Error())
}

// check if there was an error while reading from the stream
if readErr != nil {
return status.Errorf(codes.Internal, readErr.Error())
return status.Errorf(codes.Internal, "%s", readErr.Error())
}
return nil
}
Expand Down Expand Up @@ -158,7 +158,7 @@ func (fs *Service) handleRequest(ctx context.Context, req *v1.SourceTransformReq
defer func() {
if r := recover(); r != nil {
log.Printf("panic inside handler: %v %v", r, string(debug.Stack()))
err = errTransformerPanic
err = fmt.Errorf("%s: %v", errTransformerPanic, r)
}
}()

Expand Down
Loading