diff --git a/runtime/v2/shim/shim.go b/runtime/v2/shim/shim.go index 7487ca043..a6078a569 100644 --- a/runtime/v2/shim/shim.go +++ b/runtime/v2/shim/shim.go @@ -417,10 +417,9 @@ func run(ctx context.Context, manager Manager, initFunc Init, name string, confi if err != nil { if plugin.IsSkipPlugin(err) { log.G(ctx).WithError(err).WithField("type", p.Type).Infof("skip loading plugin %q...", id) - } else { - log.G(ctx).WithError(err).Warnf("failed to load plugin %s", id) + continue } - continue + return fmt.Errorf("failed to load plugin %s: %w", id, err) } if src, ok := instance.(ttrpcService); ok { @@ -434,6 +433,10 @@ func run(ctx context.Context, manager Manager, initFunc Init, name string, confi } } + if len(ttrpcServices) == 0 { + return fmt.Errorf("required that ttrpc service") + } + unaryInterceptor := chainUnaryServerInterceptors(ttrpcUnaryInterceptors...) server, err := newServer(ttrpc.WithUnaryServerInterceptor(unaryInterceptor)) if err != nil {