Răsfoiți Sursa

[Feature] Fix Twitter Exception

monf 8 ani în urmă
părinte
comite
be37237e58
1 a modificat fișierele cu 6 adăugiri și 6 ștergeri
  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,