v0.0.326 ginext::WithSession
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m38s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m38s
This commit is contained in:
@@ -14,7 +14,13 @@ func Wrap(w *GinWrapper, fn WHandlerFunc) gin.HandlerFunc {
|
||||
|
||||
reqctx := g.Request.Context()
|
||||
|
||||
wrap, stackTrace, panicObj := callPanicSafe(fn, PreContext{wrapper: w, ginCtx: g})
|
||||
pctx := PreContext{
|
||||
wrapper: w,
|
||||
ginCtx: g,
|
||||
persistantData: &preContextData{},
|
||||
}
|
||||
|
||||
wrap, stackTrace, panicObj := callPanicSafe(fn, pctx)
|
||||
if panicObj != nil {
|
||||
|
||||
fmt.Printf("\n======== ======== STACKTRACE ======== ========\n%s\n======== ======== ======== ========\n\n", stackTrace)
|
||||
@@ -32,6 +38,13 @@ func Wrap(w *GinWrapper, fn WHandlerFunc) gin.HandlerFunc {
|
||||
panic("Writing in WrapperFunc is not supported")
|
||||
}
|
||||
|
||||
if pctx.persistantData.sessionObj != nil {
|
||||
err := pctx.persistantData.sessionObj.Finish(reqctx, wrap)
|
||||
if err != nil {
|
||||
wrap = Error(exerr.Wrap(err, "Failed to finish session").Any("originalResponse", wrap).Build())
|
||||
}
|
||||
}
|
||||
|
||||
if reqctx.Err() == nil {
|
||||
wrap.Write(g)
|
||||
}
|
||||
|
Reference in New Issue
Block a user