slack-samples / deno-starter-template

A template for building Slack apps with Deno
MIT License
107 stars 20 forks source link

Gracefully handle errors from the `datastore.put` response #48

Closed zimeg closed 10 months ago

zimeg commented 1 year ago

Type of change

Summary

This PR adds error handling to the datastore.put call, returning an error if this call is unsuccessful. Related tests are also added.

Unsure if this is the ideal way to mock different responses or if this is how we'd like to handle this error case, so please feel free to suggest alternatives!

Notes

Mocked responses were updated to match https://api.slack.com/methods/apps.datastore.put#examples

Requirements

zimeg commented 10 months ago

@hello-ashleyintech no worries at all! The LGTM is always appreciated 🙌