Skip to content

Commit

Permalink
Fix error handling (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
crspeller authored and levb committed Jun 4, 2019
1 parent e2c8388 commit 60b216a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ func (p *Plugin) OnActivate() error {
}
p.API.RegisterCommand(getCommand())

botId, appErr := p.Helpers.EnsureBot(&model.Bot{
botId, err := p.Helpers.EnsureBot(&model.Bot{
Username: "github",
DisplayName: "GitHub",
Description: "Created by the GitHub plugin.",
})
if appErr != nil {
return errors.Wrap(appErr, "failed to ensure github bot")
if err != nil {
return errors.Wrap(err, "failed to ensure github bot")
}
p.BotUserID = botId

Expand All @@ -106,7 +106,7 @@ func (p *Plugin) OnActivate() error {
return errors.Wrap(err, "couldn't read profile image")
}

appErr = p.API.SetProfileImage(botId, profileImage)
appErr := p.API.SetProfileImage(botId, profileImage)
if appErr != nil {
return errors.Wrap(appErr, "couldn't set profile image")
}
Expand Down

0 comments on commit 60b216a

Please sign in to comment.