core, eth, les, rpc: polish catalyst errors, add context

This commit is contained in:
Péter Szilágyi
2022-05-20 12:15:54 +03:00
parent 4a4d531052
commit 34bda5eae3
4 changed files with 47 additions and 26 deletions
-10
View File
@@ -54,7 +54,6 @@ var (
_ Error = new(invalidRequestError)
_ Error = new(invalidMessageError)
_ Error = new(invalidParamsError)
_ Error = new(CustomError)
)
const defaultErrorCode = -32000
@@ -102,12 +101,3 @@ type invalidParamsError struct{ message string }
func (e *invalidParamsError) ErrorCode() int { return -32602 }
func (e *invalidParamsError) Error() string { return e.message }
type CustomError struct {
Code int
ValidationError string
}
func (e *CustomError) ErrorCode() int { return e.Code }
func (e *CustomError) Error() string { return e.ValidationError }