fixed error return value (#32)
This commit is contained in:
parent
7b303129b9
commit
5d938afef2
@ -50,9 +50,10 @@ func checkFacebookError(r io.Reader) error {
|
|||||||
err = json.NewDecoder(r).Decode(&qr)
|
err = json.NewDecoder(r).Decode(&qr)
|
||||||
if qr.Error != nil {
|
if qr.Error != nil {
|
||||||
err = fmt.Errorf("Facebook error : %s", qr.Error.Message)
|
err = fmt.Errorf("Facebook error : %s", qr.Error.Message)
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return err
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Response is used for responding to events with messages.
|
// Response is used for responding to events with messages.
|
||||||
@ -151,9 +152,7 @@ func (r *Response) AttachmentData(dataType AttachmentType, filename string, file
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
var res bytes.Buffer
|
return checkFacebookError(resp.Body)
|
||||||
res.ReadFrom(resp.Body)
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ButtonTemplate sends a message with the main contents being button elements
|
// ButtonTemplate sends a message with the main contents being button elements
|
||||||
|
Loading…
Reference in New Issue
Block a user