Skip to content

Commit

Permalink
support indents before expection
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad committed Feb 22, 2024
1 parent ad889e1 commit 58deac3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 0 additions & 4 deletions crashreport.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ func parseHeadThread(sc *lineScanner) (res HeadThread, err error) {
}
}
}
return
}

// -- Affected level --
Expand Down Expand Up @@ -166,7 +165,6 @@ func parseAffectedLevel(sc *lineScanner) (res AffectedLevel, err error) {
}
firstline = false
}
return
}

type DetailsItem struct {
Expand Down Expand Up @@ -198,7 +196,6 @@ func parseDetailsItem(sc *lineScanner) (res DetailsItem, err error) {
}
firstline = false
}
return
}

type CrashReport struct { // ---- Minecraft Crash Report ----
Expand Down Expand Up @@ -271,7 +268,6 @@ func ParseCrashReport(r io.Reader) (report *CrashReport, err error) {
}
}
}
return
}

func (report *CrashReport) GetDetails(key string) (value DetailsItem) {
Expand Down
5 changes: 2 additions & 3 deletions jerror.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

var (
javaErrorMatcher = regexp.MustCompile(`^(?:\s*Exception in thread "[^"]+"\s+)?([\w\d$_]+(?:\.[\w\d$_]+)+):\s+(.*)$`)
javaErrorMatcher = regexp.MustCompile(`^\s*(?:\s*Exception in thread "[^"]+"\s+)?([\w\d$_]+(?:\.[\w\d$_]+)+):\s+(.*)$`)
stackInfoMatcher = regexp.MustCompile(`^\s+at\s+([\w\d$_]+(?:\.[\w\d$_]+)+)\.([\w\d$_<>]+)`)
)

Expand Down Expand Up @@ -66,7 +66,6 @@ func parseStacktrace0(sc *lineScanner) (st Stacktrace) {
return
}
}
return
}

func parseJavaError(sc *lineScanner) (je *JavaError) {
Expand Down Expand Up @@ -134,7 +133,7 @@ func scanJavaErrors(r io.Reader, cb func(*JavaError)) (err error) {
Stacktrace: st,
LineNo: lineNo,
}
if line, ok := strings.CutPrefix(sc.Text(), "Caused by: "); ok {
if line, ok := strings.CutPrefix(strings.TrimSpace(sc.Text()), "Caused by: "); ok {
je.CausedBy = parseJavaError0(line, sc)
}
cb(je)
Expand Down

0 comments on commit 58deac3

Please sign in to comment.