···1818func (e *Engine) SendSlackMsg(ctx context.Context, msg string) error {
1919 // loosely based on: https://golangcode.com/send-slack-messages-without-a-library/
20202121- body, _ := json.Marshal(SlackWebhookBody{Text: msg})
2121+ body, err := json.Marshal(SlackWebhookBody{Text: msg})
2222+ if err != nil {
2323+ return err
2424+ }
2225 req, err := http.NewRequestWithContext(ctx, http.MethodPost, e.SlackWebhookURL, bytes.NewBuffer(body))
2326 if err != nil {
2427 return err
···3538 buf := new(bytes.Buffer)
3639 buf.ReadFrom(resp.Body)
3740 if resp.StatusCode != 200 || buf.String() != "ok" {
3838- // TODO: in some cases print body? eg, if short and text
3941 return fmt.Errorf("failed slack webhook POST request. status=%d", resp.StatusCode)
4042 }
4143 return nil
+1-1
cmd/hepa/server.go
···5555 return nil, fmt.Errorf("specified bgs host must include 'ws://' or 'wss://'")
5656 }
57575858- // TODO: this isn't a very robust way to handle a peristent client
5858+ // TODO: this isn't a very robust way to handle a persistent client
5959 var xrpcc *xrpc.Client
6060 if config.ModAdminToken != "" {
6161 xrpcc = &xrpc.Client{