Skip to content

cache types: how do I identify error types? #2442

Answered by mihaitodor
smousa asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @smousa 👋 You can use a switch processor and check the suffix of error(), something like check: error().has_suffix("key does not exist") to detect if it was a cache miss or, depending on the cache type, some other error. Benthos will surface connection errors from various caches, but it doesn't attempt to expose generic errors. For example for aws_s3, you might get something like "operator failed for key 'test': operation error S3: GetObject, resolve auth scheme: resolve endpoint: endpoint rule error, Invalid region: region was not a valid DNS name." or for redis you might get "operator failed for key 'test': dial tcp [::1]:6397: connect: connection refused". However, I think you only…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by smousa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants