Effect CommunityEC
Effect Community3y ago
3 replies
peachneo

Error Handling for Interacting with Resources

More a general question re. error handling. Not sure if there's a "right" answer to this.

Say I'm interacting with a resource, a key value store (s3 bucket, redis, whatever) - I'm not clear on all its failure modes and I'm not willing to invest the time to track them all down.

would it make sense to have a generic "ResourceError" and catch them all at some level? Would it be better to treat these as defects?
Is there a way to get the best of both worlds and group certain error types, to preserve granularity but allow for a central error handler for those that fit in a specific group (eg perhaps retrying for a "ResourceError" that may have failed for some ephemeral reason)
Was this page helpful?