Explorar o código

clarify which handler is not found

Dieter Plaetinck %!s(int64=10) %!d(string=hai) anos
pai
achega
194273a643
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      pkg/bus/bus.go

+ 2 - 2
pkg/bus/bus.go

@@ -1,7 +1,7 @@
 package bus
 package bus
 
 
 import (
 import (
-	"errors"
+	"fmt"
 	"reflect"
 	"reflect"
 )
 )
 
 
@@ -39,7 +39,7 @@ func (b *InProcBus) Dispatch(msg Msg) error {
 
 
 	var handler = b.handlers[msgName]
 	var handler = b.handlers[msgName]
 	if handler == nil {
 	if handler == nil {
-		return errors.New("handler not found")
+		return fmt.Errorf("handler not found for %s", msgName)
 	}
 	}
 
 
 	var params = make([]reflect.Value, 1)
 	var params = make([]reflect.Value, 1)