Adds error formatting
This commit is contained in:
@@ -88,7 +88,12 @@ func (fs *StaticFileServer) ServeHTTP(rw http.ResponseWriter, req *http.Request)
|
||||
|
||||
//chain handler interface
|
||||
func (fs *StaticFileServer) ServeHTTPContext(ctx context.Context, rw http.ResponseWriter, req *http.Request) {
|
||||
fs.ServeHTTP(rw, req)
|
||||
err := fs.ServeHTTPError(rw, req)
|
||||
if err != nil {
|
||||
fsErr := err.(StaticFileServerError)
|
||||
//use our own context aware error handler
|
||||
Error(ctx, rw, err.Error(), fsErr.status)
|
||||
}
|
||||
}
|
||||
|
||||
// chain wrapper. we just ignore the error, and send the request to
|
||||
|
||||
Reference in New Issue
Block a user