Closed khromov closed 3 years ago
This library return a custom \JoliCode\Slack\Exception\SlackErrorResponse
where you get:
getErrorCode
) which is the useful when looking at documentation (see Errors in https://api.slack.com/methods/chat.postMessage for example)Slack does not gives more informations.
From the documentation:
invalid_arguments | The method was either called with invalid arguments or some detail about the arguments passed are invalid, which is more likely when using complex arguments like blocks or attachments.
Feel free to reopen this issue if there is something we can do to help, Cheers
I'm having this issue as well with dialog.open.
https://api.slack.com/methods/dialog.open
Slack returned error code "validation_errors"
but I can't seem to get the response_metadata with the actual message of what the issue is.
$error->getMessage() = "Slack returned error code "validation_errors""
$error->getErrorCode() = "validation_errors"
That's right, the dialog.open endpoint does not allow additional properties (https://github.com/jolicode/slack-php-api/blob/a5381f275082ea9549e04ef4db890614294be9fb/resources/slack-openapi-patched.json#L13950), so we cannot read the response_metadata.messages
node in the response from Slack.
Maybe additionalProperties
should always be true.
I'm reopening this issue, thanks for your comment.
Another example of this is with views.open - a bit of a pain to debug without it
https://api.slack.com/methods/views.open
Added this MR to help solve it https://github.com/jolicode/slack-php-api/pull/125
How can I get the error message from
response_metadata
? All I can see from$e->getMessage()
isSlack returned error code "invalid_arguments"
, but how do I know which arguments?