Skip to content

Commit

Permalink
fix: linearb (keephq#1254)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahargl authored Jun 18, 2024
1 parent 4edfbf2 commit bab1054
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions keep/providers/linearb_provider/linearb_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,11 @@ def _notify(
if result.ok:
self.logger.info("Deleted incident successfully")
else:
self.logger.warning(
"Failed to delete incident", extra={**result.json()}
)
r = result.json()
# don't override message
if "message" in r:
r["message_from_linearb"] = r.pop("message")
self.logger.warning("Failed to delete incident", extra={**r})
raise Exception(f"Failed to notify linearB {result.text}")
return result.text

Expand Down Expand Up @@ -228,9 +230,13 @@ def _notify(
"Notified LinearB successfully", extra={"payload": payload}
)
else:
# don't override message
r = result.json()
if "message" in r:
r["message_from_linearb"] = r.pop("message")
self.logger.warning(
"Failed to notify linearB",
extra={**result.json(), "payload": payload},
extra={**r, "payload": payload},
)
raise Exception(f"Failed to notify linearB {result.text}")

Expand Down

0 comments on commit bab1054

Please sign in to comment.