All Web API responses contain a JSON object, which will always contain a top-level boolean property ok, indicating success or failure.
For failure results, the error property will contain a short machine-readable error code. In the case of problematic calls that could still be completed successfully, ok will be true and the warning property will contain a short machine-readable warning code (or comma-separated list of them, in the case of multiple warnings).
I propose to throw an exception when Slack returns false in ok and provides an error property.
I'm not a big fan of doing an additional json_decode for all calls, but I don't see much alternatives :confused:
Attempt at fixing #7
Slack documentation (https://api.slack.com/web) says :
I propose to throw an exception when Slack returns
false
inok
and provides anerror
property. I'm not a big fan of doing an additionaljson_decode
for all calls, but I don't see much alternatives :confused: