Commit e3e21bdd authored by Jiankun Yang's avatar Jiankun Yang Committed by GitHub

fix: check http status code when get preimage from plasma (#10101)

parent 09137768
......@@ -42,6 +42,9 @@ func (c *DAClient) GetInput(ctx context.Context, comm Keccak256Commitment) ([]by
if resp.StatusCode == http.StatusNotFound {
return nil, ErrNotFound
}
if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("failed to get preimage: %v", resp.StatusCode)
}
defer resp.Body.Close()
input, err := io.ReadAll(resp.Body)
if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment