Skip to content

Commit ee538d6

Browse files
committed
improves error handling
1 parent b664087 commit ee538d6

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [unreleased]
99

10+
## [0.24.1] - 2024-09-07
11+
12+
- Improves debug logs for error handlers.
13+
1014
## [0.24.0] - 2024-07-29
1115

1216
### Changes

supertokens/constants.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const (
2121
)
2222

2323
// VERSION current version of the lib
24-
const VERSION = "0.24.0"
24+
const VERSION = "0.24.1"
2525

2626
var (
2727
cdiSupported = []string{"3.1"}

supertokens/supertokens.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,15 @@ func (s *superTokens) errorHandler(originalError error, req *http.Request, res h
335335
}
336336
for _, recipe := range s.RecipeModules {
337337
LogDebugMessage("errorHandler: Checking recipe for match: " + recipe.recipeID)
338+
LogDebugMessage("errorHandler: error: " + originalError.Error())
338339
if recipe.HandleError != nil {
339-
LogDebugMessage("errorHandler: Matched with recipeId: " + recipe.recipeID)
340340
handled, err := recipe.HandleError(originalError, req, res, userContext)
341341
if err != nil {
342+
LogDebugMessage("errorHandler: error from error handler " + err.Error())
342343
return err
343344
}
344345
if handled {
346+
LogDebugMessage("errorHandler: Matched with recipeId: " + recipe.recipeID)
345347
return nil
346348
}
347349
}

0 commit comments

Comments
 (0)