mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
Additional error handling.
This commit is contained in:
parent
b8bd17de28
commit
cd9c7bea60
1 changed files with 6 additions and 1 deletions
|
|
@ -136,7 +136,12 @@ func handler(w http.ResponseWriter, r *http.Request, dpa *DPA) {
|
||||||
size, err := manifestReader.Read(manifest)
|
size, err := manifestReader.Read(manifest)
|
||||||
if int64(size) < manifestReader.Size() {
|
if int64(size) < manifestReader.Size() {
|
||||||
dpaLogger.Debugf("Swarm: Manifest %s not found.", name)
|
dpaLogger.Debugf("Swarm: Manifest %s not found.", name)
|
||||||
|
if err == nil {
|
||||||
|
http.Error(w, "Manifest retrieval cut short: "+string(size)+" "+string(manifestReader.Size()),
|
||||||
|
http.StatusNotFound)
|
||||||
|
} else {
|
||||||
http.Error(w, err.Error(), http.StatusNotFound)
|
http.Error(w, err.Error(), http.StatusNotFound)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
dpaLogger.Debugf("Swarm: Manifest %s retrieved.", name)
|
dpaLogger.Debugf("Swarm: Manifest %s retrieved.", name)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue