You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kibble.apache.org by hu...@apache.org on 2017/12/06 22:52:29 UTC
[kibble-scanners] 03/05: catch exception and store in db if we fail
to scan
This is an automated email from the ASF dual-hosted git repository.
humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kibble-scanners.git
commit 7c57f8c85fa510931d55eb28c404fd92d3ee7938
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Wed Dec 6 12:13:25 2017 +0100
catch exception and store in db if we fail to scan
---
src/plugins/scanners/twitter.py | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/plugins/scanners/twitter.py b/src/plugins/scanners/twitter.py
index e72f957..2ef9077 100644
--- a/src/plugins/scanners/twitter.py
+++ b/src/plugins/scanners/twitter.py
@@ -120,7 +120,17 @@ def scan(KibbleBit, source):
KibbleBit.pprint("Could not verify twitter creds, aborting!")
return
# Start by getting and saving followers
- getFollowers(KibbleBit, source, t)
+ try:
+ getFollowers(KibbleBit, source, t)
+ except Exception as err:
+ source['steps']['twitter'] = {
+ 'time': time.time(),
+ 'status': 'Could not scan Twitter: %s' % err,
+ 'running': False,
+ 'good': False
+ }
+ KibbleBit.updateSource(source)
+ KibbleBit.pprint("Twitter scan failed: %s" % err)
# All done, report that!
source['steps']['twitter'] = {
--
To stop receiving notification emails like this one, please contact
"commits@kibble.apache.org" <co...@kibble.apache.org>.