mirror of
https://gitee.com/johng/gf
synced 2026-07-07 06:15:15 +08:00
improve gerror for stack information; fix issue in gconv.String for nil *time.Time type
This commit is contained in:
@ -9,6 +9,7 @@ package gerror
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/gogf/gf/internal/intlog"
|
||||
"io"
|
||||
"runtime"
|
||||
"strings"
|
||||
@ -22,7 +23,7 @@ type Error struct {
|
||||
}
|
||||
|
||||
const (
|
||||
gFILTER_KEY = "github.com/gogf/gf/"
|
||||
gFILTER_KEY = "/errors/gerror/gerror"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -130,6 +131,19 @@ func formatSubStack(st stack, buffer *bytes.Buffer) {
|
||||
if strings.Contains(file, gFILTER_KEY) {
|
||||
continue
|
||||
}
|
||||
if !intlog.IsInGFDevelop() {
|
||||
// Avoid GF stacks if not in GF development.
|
||||
if strings.Contains(file, "github.com/gogf/gf/") {
|
||||
continue
|
||||
}
|
||||
if strings.Contains(file, "github.com/gogf/gf@") {
|
||||
continue
|
||||
}
|
||||
}
|
||||
// Avoid stack string like "<autogenerated>"
|
||||
if strings.Contains(file, "<") {
|
||||
continue
|
||||
}
|
||||
if goRootForFilter != "" && len(file) >= len(goRootForFilter) && file[0:len(goRootForFilter)] == goRootForFilter {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user