Skip to content

Commit 350b970

Browse files
committed
cosmetics
1 parent 02e7848 commit 350b970

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/torr/stream.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ func (t *Torrent) Stream(fileID int, req *http.Request, resp http.ResponseWriter
4949
}
5050

5151
if int64(sets.MaxSize) > 0 && file.Length() > int64(sets.MaxSize) {
52-
errMsg := fmt.Sprintf("file size exceeded max allowed %d bytes", sets.MaxSize)
52+
err := fmt.Errorf("file size exceeded max allowed %d bytes", sets.MaxSize)
5353
log.Println("file", file.DisplayPath(), "size exceeded max allowed", sets.MaxSize, "bytes")
54-
http.Error(resp, errMsg, http.StatusForbidden)
55-
return fmt.Errorf(errMsg)
54+
http.Error(resp, err.Error(), http.StatusForbidden)
55+
return err
5656
}
5757

5858
reader := t.NewReader(file)

0 commit comments

Comments
 (0)