Skip to content

Commit

Permalink
fix: return template on some errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nedpals committed Feb 1, 2024
1 parent 5886698 commit 0236017
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions errgoengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ func (e *ErrgoEngine) Analyze(workingPath, msg string) (*CompiledErrorTemplate,

// open contents of the extracted stack file locations
if err := ParseFromStackTrace(contextData, template, e.FS); err != nil {
return nil, nil, err
// return error template for bugbuddy to handle
// incomplete error messages
return template, nil, err
}

// locate main error
Expand All @@ -90,7 +92,9 @@ func (e *ErrgoEngine) Analyze(workingPath, msg string) (*CompiledErrorTemplate,
Nearest: WrapNode(doc, nearest),
}
} else {
return nil, nil, fmt.Errorf("main trace node document not found")
// return error template for bugbuddy to handle
// incomplete error messages
return template, nil, fmt.Errorf("main trace node document not found")
}

if contextData.MainError != nil && template.OnAnalyzeErrorFn != nil {
Expand Down

0 comments on commit 0236017

Please sign in to comment.