add data to jsonrpc error response

This commit is contained in:
Samuel Lorch 2023-03-06 23:49:41 +01:00
parent ec0d62e32e
commit 0a51ba0beb

View file

@ -20,6 +20,8 @@ const (
type respError struct { type respError struct {
Code ErrorCode `json:"code"` Code ErrorCode `json:"code"`
Message string `json:"message"` Message string `json:"message"`
// cannot be omitempty because of frontend library
Data any `json:"data"`
} }
func respondError(w io.Writer, id any, code ErrorCode, err error) error { func respondError(w io.Writer, id any, code ErrorCode, err error) error {