Skip to content

Commit

Permalink
Merge 7eed155 into 9745e73
Browse files Browse the repository at this point in the history
  • Loading branch information
ovv committed Jun 15, 2018
2 parents 9745e73 + 7eed155 commit 4c65879
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions isitdown/notifiers/__init__.py
Expand Up @@ -30,7 +30,14 @@ async def error(self, result):

self.errors[result.check] += 1
self.states[result.check] = state.ERROR
await self._dispatch_error(result)
try:
await self._dispatch_error(result)
except Exception:
LOG.exception(
"Error while notifying: %s, state: %s",
result.check,
self.states[result.check],
)

async def ok(self, result):
if result.check not in self.errors:
Expand All @@ -41,9 +48,23 @@ async def ok(self, result):
if self.states[result.check] == state.ERROR:
self.states[result.check] = state.OK
self.errors[result.check] = 0
await self._recover(result)
try:
await self._recover(result)
except Exception:
LOG.exception(
"Error while notifying: %s, state: %s",
result.check,
self.states[result.check],
)
else:
await self._ok(result)
try:
await self._ok(result)
except Exception as e:
LOG.exception(
"Error while notifying: %s, state: %s",
result.check,
self.states[result.check],
)

async def _dispatch_error(self, result):

Expand Down

0 comments on commit 4c65879

Please sign in to comment.