8000 Errors are shown publicly · Issue #121 · go-chat-bot/bot · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Mar 11, 2024. It is now read-only.
This repository was archived by the owner on Mar 11, 2024. It is now read-only.
Errors are shown publicly #121
Open
Open
@ghost

Description

Parsing errors are shown publicly, which is kinda odd considering that "command not found", which undoubtably is thrown more frequent, is only logged.

I believe these lines are at fault, https://github.com/go-chat-bot/bot/blob/master/bot.go#L183-L187

Patch attached:

Index: bot.go
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- bot.go	(revision 3da6cae4547763aa55828a9f75ed4693bed5d36f)
+++ bot.go	(date 1574671039000)
@@ -180,11 +180,7 @@
 func (b *Bot) MessageReceived(channel *ChannelData, message *Message, sender *User) {
 	command, err := parse(message, channel, sender)
 	if err != nil {
-		b.SendMessage(OutgoingMessage{
-			Target:  channel.Channel,
-			Message: err.Error(),
-			Sender:  sender,
-		})
+		log.Fatalf("Error: %v, Channel: %v, Sender: %v", channel.Channel, err.Error(), sender.ID)
 		return
 	}
 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0