Skip to content

Commit 5ce15ca

Browse files
committed
refactor: use error directly in string formatting
1 parent 93a2a16 commit 5ce15ca

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

pkg/context/shared/infrastructure/communications/rabbitmq/rabbitmq.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,14 @@ func (rabbitMQ *RabbitMQ) AddQueueConsumer(consumer messages.Consumer) error {
146146
err := json.Unmarshal(delivery.Body, message)
147147

148148
if err != nil {
149-
rabbitMQ.Logger.Error(fmt.Sprintf("Failed to deliver a message with id [%s] from queue [%s]: [%s]", message.Id, queue.Name, err.Error()))
149+
rabbitMQ.Logger.Error(fmt.Sprintf("Failed to deliver a message with id [%s] from queue [%s]: [%s]", message.Id, queue.Name, err))
150150
continue
151151
}
152152

153153
err = consumer.On(message)
154154

155155
if err != nil {
156-
rabbitMQ.Logger.Error(fmt.Sprintf("Failed to consume a message with id [%s] from queue [%s]: [%s]", message.Id, queue.Name, err.Error()))
156+
rabbitMQ.Logger.Error(fmt.Sprintf("Failed to consume a message with id [%s] from queue [%s]: [%s]", message.Id, queue.Name, err))
157157
continue
158158
}
159159

pkg/context/shared/infrastructure/records/log/log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func (color *Log) Error(message string) {
1919
}
2020

2121
func (color *Log) Fatal(message string) {
22-
log.Fatal(color.Red.Sprint(message))
22+
log.Fatalln(color.Red.Sprint(message))
2323
}
2424

2525
func (color *Log) Info(message string) {

0 commit comments

Comments
 (0)