Skip to content

Commit

Permalink
tencentcloud json marshaling err handling
Browse files Browse the repository at this point in the history
  • Loading branch information
dzyanis committed Mar 16, 2022
1 parent 40b513e commit 9b3af14
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions provider/tencentcloud/tencentcloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ func truncateString(str string, num int) string {
}

func (tencentcloud *TencentCloud) Send(message sachet.Message) error {
var err error = nil
switch message.Type {
case "", "text":
request := sms.NewSendSmsRequest()
Expand All @@ -75,8 +74,12 @@ func (tencentcloud *TencentCloud) Send(message sachet.Message) error {
fmt.Printf("An API error has returned: %s", err)
return err
}
b, _ := json.Marshal(response.Response)
b, err := json.Marshal(response.Response)
if err != nil {
return err
}
fmt.Printf("%s", b)
}
return err

return nil
}

0 comments on commit 9b3af14

Please sign in to comment.