Skip to content

Commit

Permalink
Merge pull request rapidpro#311 from nyaruka/activate-fba
Browse files Browse the repository at this point in the history
Only log channel events when we have a channel matched
  • Loading branch information
nicpottier authored Jun 29, 2020
2 parents 2398f97 + cfcf4bf commit b8346fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ func (s *server) channelHandleWrapper(handler ChannelHandler, handlerFunc Channe
writeAndLogRequestError(ctx, ww, r, channel, err)
}

// if no events were created we still want to log this to the channel, do so
if len(events) == 0 {
// if we have a channel matched but no events were created we still want to log this to the channel, do so
if channel != nil && len(events) == 0 {
if err != nil {
logs = append(logs, NewChannelLog("Channel Error", channel, NilMsgID, r.Method, url, ww.Status(), string(request), prependHeaders(response.String(), ww.Status(), w), duration, err))
librato.Gauge(fmt.Sprintf("courier.channel_error_%s", channel.ChannelType()), secondDuration)
Expand Down

0 comments on commit b8346fd

Please sign in to comment.