mirror of
https://github.com/ossf/scorecard.git
synced 2024-09-11 08:55:27 +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"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"runtime/debug"
|
||||||
|
|
||||||
"github.com/google/osv-scanner/pkg/osvscanner"
|
"github.com/google/osv-scanner/pkg/osvscanner"
|
||||||
|
|
||||||
@ -39,6 +41,7 @@ func (v osvClient) ListUnfixedVulnerabilities(
|
|||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
err = sce.CreateInternal(sce.ErrScorecardInternal, fmt.Sprintf("osv-scanner panic: %v", r))
|
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{}
|
directoryPaths := []string{}
|
||||||
|
Loading…
Reference in New Issue
Block a user