Browse Source

Merge pull request #358 from libp2p/nit/better-reflect-error

improve error message in libp2p reflection-based transport option
pull/347/head
Steven Allen 6 years ago
committed by GitHub
parent
commit
39e17efadd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      config/reflection_magic.go

2
config/reflection_magic.go

@ -23,7 +23,7 @@ func checkReturnType(fnType, tptType reflect.Type) error {
fallthrough
case 1:
if !fnType.Out(0).Implements(tptType) {
return fmt.Errorf("expected first return value from transport constructor to be a transport")
return fmt.Errorf("transport constructor returns %s which doesn't implement %s", fnType.Out(0), tptType)
}
default:
return fmt.Errorf("expected transport constructor to return a transport and, optionally, an error")

Loading…
Cancel
Save