mandrill.Ping does not error on invalid API keys
BastiPaeltz opened this issue · 1 comments
Hey,
package main
import "github.com/mostafah/mandrill"
import "fmt"
func main() {
mandrill.Key = ""
err := mandrill.Ping()
if err != nil {
fmt.Println("Mandrill credentials not valid.")
} else {
fmt.Println("Everything ok.")
}
}
always yields "Everything ok." for me. This happens with all kind of random text. I'm on OS X (if that helps you).
Keep up the work, I like your mandrill package for its simplicity.
On a side node, the Message.Send() method doesn't error out as well for me when sending with an invalid key. Should I open a seperate issue for that?
You’re right. There was no proper error handling code at all. Not sure why and not sure how it worked until now.
Anyways, I added and tested error handling. It would be great if you could test it too.
FYI, Send
, Ping
and other request functions use the same code for sending requests and handling responses, so there was no need for another issue. All should be fixed now.
PS: Thanks for the support.