rpc: internal/ethapi: added custom error types

This commit is contained in:
Marius van der Wijden
2020-05-26 13:02:33 +02:00
committed by Péter Szilágyi
parent ca35628cc2
commit d77770d96e
4 changed files with 38 additions and 2 deletions

View File

@@ -41,6 +41,12 @@ type Error interface {
ErrorCode() int // returns the code
}
// A DataError contains some data in addition to the error message.
type DataError interface {
Error() string // returns the message
ErrorData() interface{} // returns the error data
}
// ServerCodec implements reading, parsing and writing RPC messages for the server side of
// a RPC session. Implementations must be go-routine safe since the codec can be called in
// multiple go-routines concurrently.