fb-messenger-bot-api icon indicating copy to clipboard operation
fb-messenger-bot-api copied to clipboard

Don't reject bad requests

Open huydod opened this issue 5 years ago • 1 comments

I send a quick replies as below

await client.sendQuickReplyMessage("id_here", "test", [
  {
    id: "1",
    title: "test",
    payload: "test"
  }
]);

the response from facebook is 400 bad request as below

{
  "error": {
    "message": "(#100) Invalid keys \"id\" were found in param \"message[quick_replies][0]\".",
    "type": "OAuthException",
    "code": 100,
    "fbtrace_id": "GEWn2WN2fuL"
  }
}

but the method resolves the response body instead of rejects it, so I can't catch the error message here

huydod avatar May 07 '19 15:05 huydod

Hey @huydod , based on this line I can see that if the response has error property, it rejects it with message, it does not resolve it. Same with callback option on line 70.

crisboarna avatar Mar 28 '20 10:03 crisboarna