mirror of
https://github.com/mattermost/mattermost.git
synced 2026-05-26 03:22:20 -04:00
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>
24 lines
582 B
Go
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)
|
|
}
|