func (c *workerComponent) convertServerErr(err error, msg string) error {
if code := serviceerror.ToStatus(err).Code(); code == codes.InvalidArgument || code == codes.NotFound {
return temporal.NewNonRetryableApplicationError(
msg, errorTypeInvalidRequest, err,
)
}
// All other errors will be retried.