moving withConverter call up

This commit is contained in:
Julien Neuhart
2018-04-10 18:03:35 +02:00
parent 14580e9501
commit 46d55016f0

View File

@@ -62,10 +62,11 @@ func convertHandler(next http.Handler) http.Handler {
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
logger.Error(err)
cleanup(r)
return
}
r = context.WithConverter(r, c)
path, err := c.Convert()
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
@@ -74,7 +75,6 @@ func convertHandler(next http.Handler) http.Handler {
return
}
r = context.WithConverter(r, c)
r = context.WithResultFilePath(r, path)
next.ServeHTTP(w, r)