Skip to content

Commit

Permalink
Reporting errors correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Byrd committed Dec 18, 2017
1 parent 5d67349 commit 7ecf4bd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions util.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ package telebot

import (
"encoding/json"
"fmt"
"strconv"

"github.com/pkg/errors"
)

func (b *Bot) debug(err error) {
if b.reporter != nil {
b.reporter(errors.WithStack(err))
b.reporter(err)
}
}

Expand All @@ -19,7 +18,7 @@ func (b *Bot) deferDebug() {
if err, ok := r.(error); ok {
b.debug(err)
} else if str, ok := r.(string); ok {
b.debug(fmt.Errorf("%s", str))
b.debug(errors.Errorf("%s", str))
}
}
}
Expand Down

0 comments on commit 7ecf4bd

Please sign in to comment.