HubSpot / slack-client

An asynchronous HTTP client for Slack's web API
Apache License 2.0
114 stars 53 forks source link

Add additional file errors (`file_not_found`, `file_deleted`) #320

Closed rydelaney-hs closed 8 months ago

rydelaney-hs commented 11 months ago

Expanding on the work of https://github.com/HubSpot/slack-client/pull/318 this adds two new file error deserialisers covering file_not_found and file_deleted. The case of file_not_found was found in production causing some endpoints to fail, however file_deleted is assumed to be a valid error based on this api documentation.

This PR also restructures how the error types are compared in the deserialiser, and the inheritance structure of the file error immutables to make this more flexible to add file errors in the future. Open to feedback on this new structure in case there are any better ways to pull it off, the commit messages themselves explain some more of the justification behind the changes. Additional tests have been added to cover the extra cases and all other tests pass so hopefully no regressions from this structure change.