Browse Source

[Exception] propagate message exception to mother struct

+ Changelog update
ThiBuff 7 years ago
parent
commit
834f70ae43
3 changed files with 11 additions and 5 deletions
  1. 1 0
      CHANGELOG.md
  2. 3 3
      kalliope/core/NeuronLauncher.py
  3. 7 2
      kalliope/core/NeuronModule.py

+ 1 - 0
CHANGELOG.md

@@ -9,6 +9,7 @@ v0.4.6 / 2017-10-03
 - new feature: kalliope memory
 - add espeak tts to core
 - add stt options. manual or dynamic threshold
+- Fix: neurotransmitter bracket in answer
 
 v0.4.5 / 2017-07-23
 ===================

+ 3 - 3
kalliope/core/NeuronLauncher.py

@@ -57,9 +57,9 @@ class NeuronLauncher:
                 return None
         try:
             instantiated_neuron = NeuronLauncher.launch_neuron(neuron)
-        except NeuronExceptions:
-            Utils.print_danger("ERROR: Fail to execute neuron '%s'. Missing or invalid parameter(s). Execution skipped"
-                               % neuron.name)
+        except NeuronExceptions as e:
+            Utils.print_danger("ERROR: Fail to execute neuron '%s'. "
+                               '%s' ". -> Execution skipped" % (neuron.name, e.message))
             return None
         return instantiated_neuron
 

+ 7 - 2
kalliope/core/NeuronModule.py

@@ -24,14 +24,19 @@ class InvalidParameterException(NeuronExceptions):
     """
     Some Neuron parameters are invalid.
     """
-    pass
+    def __init__(self, message):
+        # Call the base class constructor with the parameters it needs
+        super(InvalidParameterException, self).__init__(message)
 
 
 class MissingParameterException(NeuronExceptions):
     """
     Some Neuron parameters are missing.
     """
-    pass
+
+    def __init__(self, message):
+        # Call the base class constructor with the parameters it needs
+        super(MissingParameterException, self).__init__(message)
 
 
 class NoTemplateException(Exception):