mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 02:17:05 +00:00
Upgrade to new go errors and some minor fixes and improvements including easier debugging of invalid routes and e.t.c.
Former-commit-id: 5809157b952ccc61a67a9861470774b3a6fee024
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
package sessions
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/kataras/iris/core/errors"
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -78,9 +77,13 @@ func (p *provider) Init(sid string, expires time.Duration) *Session {
|
||||
return newSession
|
||||
}
|
||||
|
||||
// ErrNotFound can be returned when calling `UpdateExpiration` on a non-existing or invalid session entry.
|
||||
// It can be matched directly, i.e: `isErrNotFound := sessions.ErrNotFound.Equal(err)`.
|
||||
var ErrNotFound = errors.New("not found")
|
||||
// ErrNotFound may be returned from `UpdateExpiration` of a non-existing or
|
||||
// invalid session entry from memory storage or databases.
|
||||
// Usage:
|
||||
// if err != nil && err.Is(err, sessions.ErrNotFound) {
|
||||
// [handle error...]
|
||||
// }
|
||||
var ErrNotFound = errors.New("session not found")
|
||||
|
||||
// UpdateExpiration resets the expiration of a session.
|
||||
// if expires > 0 then it will try to update the expiration and destroy task is delayed.
|
||||
|
||||
Reference in New Issue
Block a user