Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
use error instead panic (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
raffis committed Oct 25, 2021
1 parent 916e7f8 commit 6b34b8e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions kafka/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package kafka
import (
"context"
"fmt"
"github.com/pkg/errors"
k "github.com/segmentio/kafka-go"
"math"
"net"
"strconv"
"time"

"github.com/pkg/errors"
k "github.com/segmentio/kafka-go"
)

const (
Expand Down Expand Up @@ -192,7 +193,7 @@ func (c *Connection) GetTopic(name string) (*Topic, error) {

partitions, err := conn.ReadPartitions()
if err != nil {
panic(err.Error())
return nil, err
}

var numberOfPartitions int64 = 0
Expand Down

0 comments on commit 6b34b8e

Please sign in to comment.