diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-11-27 00:35:44 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-11-27 17:06:12 +0800 |
commit | 3e1000fda3424d880bc43ebbb16d8a33447d4182 (patch) | |
tree | fdc37470cba9af3a00e7eeaa02895b5166ddcd27 /node/errors.go | |
parent | 1e806c4c775bd98b224eb0249007502d348e737b (diff) | |
download | dexon-3e1000fda3424d880bc43ebbb16d8a33447d4182.tar dexon-3e1000fda3424d880bc43ebbb16d8a33447d4182.tar.gz dexon-3e1000fda3424d880bc43ebbb16d8a33447d4182.tar.bz2 dexon-3e1000fda3424d880bc43ebbb16d8a33447d4182.tar.lz dexon-3e1000fda3424d880bc43ebbb16d8a33447d4182.tar.xz dexon-3e1000fda3424d880bc43ebbb16d8a33447d4182.tar.zst dexon-3e1000fda3424d880bc43ebbb16d8a33447d4182.zip |
cmd, eth, node, rpc, xeth: use single-instance services
Diffstat (limited to 'node/errors.go')
-rw-r--r-- | node/errors.go | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/node/errors.go b/node/errors.go index f8eece06d..bd5ddeb5d 100644 --- a/node/errors.go +++ b/node/errors.go @@ -16,13 +16,27 @@ package node -import "fmt" +import ( + "fmt" + "reflect" +) -// StopError is returned if a node fails to stop either any of its registered +// DuplicateServiceError is returned during Node startup if a registered service +// constructor returns a service of the same type that was already started. +type DuplicateServiceError struct { + Kind reflect.Type +} + +// Error generates a textual representation of the duplicate service error. +func (e *DuplicateServiceError) Error() string { + return fmt.Sprintf("duplicate service: %v", e.Kind) +} + +// StopError is returned if a Node fails to stop either any of its registered // services or itself. type StopError struct { Server error - Services map[string]error + Services map[reflect.Type]error } // Error generates a textual representation of the stop error. |