mirror of
https://github.com/ossf/scorecard.git
synced 2024-08-16 11:50:37 +03:00
🌱 add stack info to osv-scanner error (#4172)
* add stack info to osv-scanner error Signed-off-by: Zxilly <zxilly@outlook.com> * print error stack to stderr Signed-off-by: Zxilly <zxilly@outlook.com> * follow the lint rule Signed-off-by: Zxilly <zxilly@outlook.com> --------- Signed-off-by: Zxilly <zxilly@outlook.com>
This commit is contained in:
parent
c7821b633c
commit
5ef9831b91
@ -18,6 +18,8 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime/debug"
|
||||
|
||||
"github.com/google/osv-scanner/pkg/osvscanner"
|
||||
|
||||
@ -39,6 +41,7 @@ func (v osvClient) ListUnfixedVulnerabilities(
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
err = sce.CreateInternal(sce.ErrScorecardInternal, fmt.Sprintf("osv-scanner panic: %v", r))
|
||||
fmt.Fprintf(os.Stderr, "osv-scanner panic: %v\n%s\n", r, string(debug.Stack()))
|
||||
}
|
||||
}()
|
||||
directoryPaths := []string{}
|
||||
|
Loading…
Reference in New Issue
Block a user