Fix renaming to correctly create the base files if missing

This commit is contained in:
Dane Everitt
2020-07-11 16:19:51 -07:00
parent d60b2d6163
commit 233cefd129
2 changed files with 16 additions and 0 deletions

View File

@@ -61,6 +61,8 @@ func (e *RequestError) AbortWithStatus(status int, c *gin.Context) {
// If this error is because the resource does not exist, we likely do not need to log
// the error anywhere, just return a 404 and move on with our lives.
if os.IsNotExist(e.Err) {
e.logger().WithField("error", e.Err).Debug("encountered os.IsNotExist error while handling request")
c.AbortWithStatusJSON(http.StatusNotFound, gin.H{
"error": "The requested resource was not found on the system.",
})