mattermost/server/public/pluginapi/experimental/common/message_attachments.go
Ben Schumacher b6e5264731
[MM-67739] Rename SlackAttachment to MessageAttachment across the codebase (#35445)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2026-03-10 16:37:21 +01:00

24 lines
582 B
Go

package common
import (
"encoding/json"
"net/http"
"github.com/mattermost/mattermost/server/public/model"
)
func MessageAttachmentError(w http.ResponseWriter, err error) {
response := model.PostActionIntegrationResponse{
EphemeralText: "Error:" + err.Error(),
}
w.Header().Set("Content-Type", "application/json")
_ = json.NewEncoder(w).Encode(response)
}
func DialogError(w http.ResponseWriter, err error) {
response := model.SubmitDialogResponse{
Error: err.Error(),
}
w.Header().Set("Content-Type", "application/json")
_ = json.NewEncoder(w).Encode(response)
}