Skip to content

Commit 0447790

Browse files
committed
chore: update error message format.
1 parent 627a8c8 commit 0447790

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rabbitmq.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ func NewWorker(opts ...Option) *Worker {
3838

3939
w.conn, err = amqp.Dial(w.opts.addr)
4040
if err != nil {
41-
panic(err)
41+
w.opts.logger.Fatal("can't connect rabbitmq:", err)
4242
}
4343

4444
w.channel, err = w.conn.Channel()
4545
if err != nil {
46-
panic(err)
46+
w.opts.logger.Fatal("can't setup channel:", err)
4747
}
4848

4949
if err := w.channel.ExchangeDeclare(
@@ -55,7 +55,7 @@ func NewWorker(opts ...Option) *Worker {
5555
false, // noWait
5656
nil, // arguments
5757
); err != nil {
58-
panic(err)
58+
w.opts.logger.Fatal("can't declares an exchange:", err)
5959
}
6060

6161
return w

0 commit comments

Comments
 (0)