瀏覽代碼

[Feature] Fix Twitter Exception

monf 8 年之前
父節點
當前提交
be37237e58
共有 1 個文件被更改,包括 6 次插入6 次删除
  1. 6 6
      neurons/twitter/Twitter.py

+ 6 - 6
neurons/twitter/Twitter.py

@@ -1,6 +1,6 @@
 import twitter
 
-from core.NeuronModule import NeuronModule
+from core.NeuronModule import NeuronModule, InvalidParameterException
 
 
 class Twitter(NeuronModule):
@@ -15,15 +15,15 @@ class Twitter(NeuronModule):
         tweet = kwargs.get('tweet', None)
 
         if consumer_key is None:
-            raise NotImplementedError("Twitter needs a consumer_key")
+            raise InvalidParameterException("Twitter needs a consumer_key")
         if consumer_secret is None:
-            raise NotImplementedError("Twitter needs a consumer_secret")
+            raise InvalidParameterException("Twitter needs a consumer_secret")
         if access_token_key is None:
-            raise NotImplementedError("Twitter needs an access_token_key")
+            raise InvalidParameterException("Twitter needs an access_token_key")
         if access_token_secret is None:
-            raise NotImplementedError("Twitter needs and access_token_secret")
+            raise InvalidParameterException("Twitter needs and access_token_secret")
         if tweet is None:
-            raise NotImplementedError("You need to provide something to tweet !")
+            raise InvalidParameterException("You need to provide something to tweet !")
 
         api = twitter.Api(consumer_key=consumer_key,
                           consumer_secret=consumer_secret,