Reporting error when smth bad happens
@@ -21,8 +21,10 @@ func (o *Manager) KeyExists(accessToken string) (bool, error) {
// Set a new access token and its session to the storage
func (o *Manager) Set(accessToken string, session session.SessionState, resetTTLTo int64) error {
- value, _ := json.Marshal(session)
- // expireDuration := time.Duration(resetTTLTo) * time.Second
+ value, err := json.Marshal(session)
+ if err != nil {
+ return err
+ }
log.Debugf("Storing key %s for %d seconds", accessToken, resetTTLTo)
go o.Storage.Set(accessToken, string(value), resetTTLTo)
