From 02360173e6b6d6c0e4fbaf684d3950c2094cbd7b Mon Sep 17 00:00:00 2001 From: Ned Palacios Date: Thu, 1 Feb 2024 09:21:44 +0800 Subject: [PATCH] fix: return template on some errors --- errgoengine.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/errgoengine.go b/errgoengine.go index 6be7510..2455877 100644 --- a/errgoengine.go +++ b/errgoengine.go @@ -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 @@ -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 {