Skip to content

Commit

Permalink
Replaces magic number with Status Not Found
Browse files Browse the repository at this point in the history
  • Loading branch information
ahasikos committed Jan 29, 2024
1 parent 366e6a8 commit 69fbed3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/blocks/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (b *Blocks) handleGetBlock(w http.ResponseWriter, req *http.Request) error
summary, err := b.getBlockSummary(revision)
if err != nil {
if b.repo.IsNotFound(err) {
return utils.HTTPError(errors.WithMessage(errors.New("Not Found"), "Block"), 404)
return utils.HTTPError(errors.WithMessage(errors.New("Not Found"), "Block"), http.StatusNotFound)

Check failure on line 46 in api/blocks/blocks.go

View workflow job for this annotation

GitHub Actions / golangci-lint

error returned from external package is unwrapped: sig: func github.com/vechain/thor/v2/api/utils.HTTPError(cause error, status int) error (wrapcheck)
}
return err
}
Expand Down

0 comments on commit 69fbed3

Please sign in to comment.