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/10/23 17:47:26 UTC
[kibble-scanners] branch master updated: if watson borks,
we bork silently
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
The following commit(s) were added to refs/heads/master by this push:
new 93b61fb if watson borks, we bork silently
93b61fb is described below
commit 93b61fb22f5a5bc3a15f1950abcb2ca798f6364e
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Mon Oct 23 19:47:19 2017 +0200
if watson borks, we bork silently
---
src/plugins/utils/tone.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/plugins/utils/tone.py b/src/plugins/utils/tone.py
index 85d9cad..7b8d636 100644
--- a/src/plugins/utils/tone.py
+++ b/src/plugins/utils/tone.py
@@ -52,7 +52,10 @@ def getTone(KibbleBit, body):
)
mood = {}
jsout = rv.json()
- for tone in jsout['document_tone']['tones']:
- mood[tone['tone_id']] = tone['score']
+ if 'document_tone' in jsout:
+ for tone in jsout['document_tone']['tones']:
+ mood[tone['tone_id']] = tone['score']
+ else:
+ KibbleBit.pprint("Failed to analyze email body.")
return mood
--
To stop receiving notification emails like this one, please contact
['"commits@kibble.apache.org" <co...@kibble.apache.org>'].