if a converter has been created, cleanup its file if an error happens

This commit is contained in:
Julien Neuhart
2018-04-11 09:47:54 +02:00
parent 46d55016f0
commit f59054b5e0
2 changed files with 8 additions and 2 deletions

View File

@@ -62,6 +62,12 @@ func convertHandler(next http.Handler) http.Handler {
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
logger.Error(err)
if c != nil {
r = context.WithConverter(r, c)
cleanup(r)
}
return
}