Skip to content

Commit 69490dd

Browse files
authored
🔧 chore: handle more types of plugin related api errors (#95341)
1 parent 24c9048 commit 69490dd

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/sentry_plugins/amazon_sqs/plugin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ def sqs_send_message(message):
191191
return False
192192
elif str(e).endswith("must contain the parameter MessageGroupId."):
193193
return False
194-
elif str(e).startswith("An error occurred (NoSuchBucket)"):
194+
elif str(e).startswith("An error occurred (NoSuchBucket)") or str(e).startswith(
195+
"An error occurred (IllegalLocationConstraintException)"
196+
):
195197
# If there's an issue with the user's s3 bucket then we can't do
196198
# anything to recover. Just continue.
197199
return False

src/sentry_plugins/splunk/plugin.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,7 @@ def forward_event(self, event: Event, payload: MutableMapping[str, Any]) -> bool
222222
# These two are already handled by the API client, Just log and return.
223223
isinstance(exc, (ApiHostError, ApiTimeoutError))
224224
# Most 4xxs are not errors or actionable for us do not re-raise.
225-
or (exc.code is not None and (401 <= exc.code <= 404))
226-
# 502s are too noisy.
227-
or exc.code == 502
228-
or exc.code == 405
229-
# Method not allowed for the url
230-
# This is caused by webhook being misconfigured, something we can't fix.
225+
or (exc.code is not None and (401 <= exc.code <= 405) or exc.code in (502, 504))
231226
):
232227
return False
233228
raise

0 commit comments

Comments
 (0)