Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

MessageSendResponseBody #8

Open
gertjanwytynck opened this issue Dec 23, 2016 · 1 comment
Open

MessageSendResponseBody #8

gertjanwytynck opened this issue Dec 23, 2016 · 1 comment

Comments

@gertjanwytynck
Copy link

gertjanwytynck commented Dec 23, 2016

Hi,

When I try to send a message and I have an error type MessageSendResponseBody is always empty.
Does anyone has an idea what I do wrong?

client := plivo.NewClient(nil, authID, authToken)
errMessage, resp, err := client.Message.Send(params)

log.Println(errMessage.Error)
log.Println(errMessage.Message)
log.Println(errMessage.ApiID)
log.Println(err.Error())

err.Error() does not contain the correct error message and errMessage is empty but it should be:

{
  "api_id": "my-api-id",
  "error": "InsufficientCredit"
}

I think the code never reaches line 146 because checkResponse is never nil -> https://github.com/micrypt/go-plivo/blob/master/plivo/plivo.go

Thanks in advance,
Greetings,
Gertjan

@gertjanwytynck
Copy link
Author

I've made a PR: #9

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant