celestiaorg / go-cnc

celestia-node REST client in Go.
Apache License 2.0
15 stars 8 forks source link

fix: marshal error response into struct instead of into string #24

Closed distractedm1nd closed 2 years ago

distractedm1nd commented 2 years ago

Once https://github.com/celestiaorg/celestia-node/pull/1062/ is merged, errors written from the node will write errors as JSON, meaning we have to marshal them with a struct like:

type JSONError struct {
    Err string `json:"error"`
}

when calling SetError (instead of into a string)

distractedm1nd commented 2 years ago

I can do this once the PR is merged, but it of course will not work for older versions of the node