Correctly abort on file missing without panic
This commit is contained in:
parent
8920f919b1
commit
56af6fc1f8
|
@ -30,6 +30,7 @@ func getServerFileContents(c *gin.Context) {
|
||||||
f, st, err := s.Filesystem().File(p)
|
f, st, err := s.Filesystem().File(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
middleware.CaptureAndAbort(c, err)
|
middleware.CaptureAndAbort(c, err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
|
||||||
|
@ -48,6 +49,7 @@ func getServerFileContents(c *gin.Context) {
|
||||||
// take since a panic will at least be recovered and this should be incredibly
|
// take since a panic will at least be recovered and this should be incredibly
|
||||||
// rare?
|
// rare?
|
||||||
middleware.CaptureAndAbort(c, err)
|
middleware.CaptureAndAbort(c, err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user