Session DB File Storage: Catch and Log any error (i.e if access denied) as requested https://github.com/kataras/iris/issues/704#issuecomment-319804704

Former-commit-id: 6a96da0bde5ae8d999fc9c1e6af49db2a893a6d5
This commit is contained in:
kataras 2017-08-03 00:38:17 +03:00
parent 8a7e718bb1
commit 94043bc117

View File

@ -105,7 +105,9 @@ func (d *Database) Update(sid string, newValues map[string]interface{}, expireDa
})
}
ioutil.WriteFile(d.sessPath(sid), serialize(newValues), os.FileMode(PathFileMode))
if err := ioutil.WriteFile(d.sessPath(sid), serialize(newValues), os.FileMode(PathFileMode)); err != nil {
golog.Errorf("error while writing the session to the file: %v", err)
}
}
// SerializeBytes serializes the "m" into bytes using gob encoder and and returns the result.