summaryrefslogtreecommitdiff
path: root/plugins/rpc
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-01-21 13:25:36 +0300
committerValery Piashchynski <[email protected]>2021-01-21 13:25:36 +0300
commit7da6c78449776e1f3c6716250bca0b712a0423a4 (patch)
treef3512de66aca2bba408485a0ea2fc936c0e4fb9b /plugins/rpc
parent0ff05b2732b4fd0783f959c94c54d7e39169f979 (diff)
Uniform all configs
Add debug server Check nil's for all plugin intialization
Diffstat (limited to 'plugins/rpc')
-rw-r--r--plugins/rpc/plugin.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/rpc/plugin.go b/plugins/rpc/plugin.go
index c5813e7b..84ebb3d0 100644
--- a/plugins/rpc/plugin.go
+++ b/plugins/rpc/plugin.go
@@ -33,7 +33,7 @@ type Plugin struct {
// Init rpc service. Must return true if service is enabled.
func (s *Plugin) Init(cfg config.Configurer, log logger.Logger) error {
- const op = errors.Op("rpc plugin init")
+ const op = errors.Op("rpc_plugin_init")
if !cfg.Has(PluginName) {
return errors.E(op, errors.Disabled)
}
@@ -54,7 +54,7 @@ func (s *Plugin) Init(cfg config.Configurer, log logger.Logger) error {
// Serve serves the service.
func (s *Plugin) Serve() chan error {
- const op = errors.Op("serve rpc plugin")
+ const op = errors.Op("rpc_plugin_serve")
errCh := make(chan error, 1)
s.rpc = rpc.NewServer()
@@ -105,11 +105,12 @@ func (s *Plugin) Serve() chan error {
// Stop stops the service.
func (s *Plugin) Stop() error {
+ const op = errors.Op("rpc_plugin_stop")
// store closed state
atomic.StoreUint32(s.closed, 1)
err := s.listener.Close()
if err != nil {
- return errors.E(errors.Op("stop RPC socket"), err)
+ return errors.E(op, err)
}
return nil
}