File tree 1 file changed +14
-4
lines changed
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -857,13 +857,23 @@ def add_context(*args, **kwargs):
857
857
output_value = func (* args , ** kwargs )
858
858
if multi :
859
859
if not isinstance (output_value , (list , tuple )):
860
- raise Exception ('Invalid output value' )
860
+ raise exceptions .InvalidCallbackReturnValue (
861
+ 'The callback {} is a multi-output.\n '
862
+ 'Expected the output type to be a list'
863
+ ' or tuple but got {}.' .format (
864
+ callback_id , repr (output_value )
865
+ )
866
+ )
861
867
862
868
if not len (output_value ) == len (output ):
863
- raise Exception (
864
- 'Invalid number of output values. '
869
+ raise exceptions . InvalidCallbackReturnValue (
870
+ 'Invalid number of output values for {}. \n '
865
871
' Expected {} got {}' .format (
866
- len (output ), len (output_value )))
872
+ callback_id ,
873
+ len (output ),
874
+ len (output_value )
875
+ )
876
+ )
867
877
868
878
props = collections .defaultdict (dict )
869
879
for i , out in enumerate (output ):
You can’t perform that action at this time.
0 commit comments