Permalink
Browse files

Issue 90. Nix silly exception "handling"

The problem here is that it's logging as an error and then re-raising.
That's kind of irritating. It's better to just let it propagate back
to the application and let it do whatever it wants to do.

Amongst other things, this is less spammy with sentry.
  • Loading branch information...
1 parent ccff9b2 commit 714a5c95ad479ed913c27de86a6a1f58a0a1a58a @willkg willkg committed Dec 3, 2012
Showing with 6 additions and 11 deletions.
  1. +6 −11 elasticutils/__init__.py
View
17 elasticutils/__init__.py
@@ -694,11 +694,9 @@ def raw(self):
"""
qs = self._build_query()
es = self.get_es()
- try:
- hits = es.search(qs, self.get_indexes(), self.get_doctypes())
- except Exception:
- log.error(qs)
- raise
+
+ hits = es.search(qs, self.get_indexes(), self.get_doctypes())
+
log.debug('[%s] %s' % (hits['took'], qs))
return hits
@@ -825,12 +823,9 @@ def raw(self):
if self.s:
kwargs['body'] = self.s._build_query()
- try:
- hits = es._send_request('GET', path, **kwargs)
- log.debug(hits)
- except Exception:
- log.error(kwargs)
- raise
+ hits = es._send_request('GET', path, **kwargs)
+ log.debug(hits)
+
log.debug('[%s] %s' % (hits['took'], kwargs))
return hits

0 comments on commit 714a5c9

Please sign in to comment.