fix(wecom-aibot): correct variable name in JSON parsing in message callback handler
This commit is contained in:
parent
6caee427bb
commit
c7d4012fc9
1 changed files with 2 additions and 2 deletions
|
|
@ -351,9 +351,9 @@ func (c *WeComAIBotChannel) handleMessageCallback(
|
||||||
var encryptedMsg struct {
|
var encryptedMsg struct {
|
||||||
Encrypt string `json:"encrypt"`
|
Encrypt string `json:"encrypt"`
|
||||||
}
|
}
|
||||||
if err := json.Unmarshal(body, &encryptedMsg); err != nil {
|
if unmarshalErr := json.Unmarshal(body, &encryptedMsg); unmarshalErr != nil {
|
||||||
logger.ErrorCF("wecom_aibot", "Failed to parse JSON body", map[string]any{
|
logger.ErrorCF("wecom_aibot", "Failed to parse JSON body", map[string]any{
|
||||||
"error": err,
|
"error": unmarshalErr,
|
||||||
"body": string(body),
|
"body": string(body),
|
||||||
})
|
})
|
||||||
http.Error(w, "Failed to parse JSON", http.StatusBadRequest)
|
http.Error(w, "Failed to parse JSON", http.StatusBadRequest)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue