Skip to content

Commit

Permalink
feat(error): update skip++
Browse files Browse the repository at this point in the history
  • Loading branch information
Aoi-hosizora committed Jul 16, 2020
1 parent 85017c1 commit 196a236
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion xdto/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ type ErrorDto struct {
// Build a basic dto (only include time, type, detail, request)
// noinspection GoUnusedExportedFunction
func BuildBasicErrorDto(err interface{}, requests []string) *ErrorDto {
return BuildErrorDto(err, requests, -1, false)
return BuildErrorDto(err, requests, -2, false)
}

// Build a complete dto (also include runtime parameters)
// noinspection GoUnusedExportedFunction
func BuildErrorDto(err interface{}, requests []string, skip int, print bool) *ErrorDto {
skip++

now := time.Now().Format(time.RFC3339)
errType := fmt.Sprintf("%T", err)
errDetail := fmt.Sprintf("%v", err)
Expand Down
1 change: 1 addition & 0 deletions xfiber/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ func BuildBasicErrorDto(err interface{}, c *fiber.Ctx) *xdto.ErrorDto {

// noinspection GoUnusedExportedFunction
func BuildErrorDto(err interface{}, c *fiber.Ctx, skip int, print bool) *xdto.ErrorDto {
skip++
return xdto.BuildErrorDto(err, DumpRequest(c), skip, print)
}
1 change: 1 addition & 0 deletions xgin/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ func BuildBasicErrorDto(err interface{}, c *gin.Context) *xdto.ErrorDto {

// noinspection GoUnusedExportedFunction
func BuildErrorDto(err interface{}, c *gin.Context, skip int, print bool) *xdto.ErrorDto {
skip++
return xdto.BuildErrorDto(err, DumpRequest(c), skip, print)
}

0 comments on commit 196a236

Please sign in to comment.