@@ -33,6 +33,8 @@ import (
33
33
codeClient "github.com/snyk/code-client-go"
34
34
codeClientObservability "github.com/snyk/code-client-go/observability"
35
35
"github.com/snyk/code-client-go/scan"
36
+ "github.com/snyk/go-application-framework/pkg/local_workflows/code_workflow"
37
+ "github.com/snyk/go-application-framework/pkg/local_workflows/code_workflow/sast_contract"
36
38
"github.com/snyk/go-application-framework/pkg/utils"
37
39
38
40
"github.com/snyk/snyk-ls/internal/types"
@@ -46,9 +48,6 @@ import (
46
48
"github.com/snyk/snyk-ls/internal/product"
47
49
"github.com/snyk/snyk-ls/internal/progress"
48
50
"github.com/snyk/snyk-ls/internal/uri"
49
-
50
- "github.com/snyk/go-application-framework/pkg/local_workflows/code_workflow"
51
- "github.com/snyk/go-application-framework/pkg/local_workflows/code_workflow/sast_contract"
52
51
)
53
52
54
53
type ScanStatus struct {
@@ -152,7 +151,16 @@ func (sc *Scanner) Scan(ctx context.Context, path types.FilePath, folderPath typ
152
151
}
153
152
154
153
gafConfig := sc .C .Engine ().GetConfiguration ()
155
- sastResponse , ok := gafConfig .Get (code_workflow .ConfigurationSastSettings ).(* sast_contract.SastResponse )
154
+
155
+ response , err := gafConfig .GetWithError (code_workflow .ConfigurationSastSettings )
156
+ if err != nil {
157
+ return nil , err
158
+ }
159
+
160
+ sastResponse , ok := response .(* sast_contract.SastResponse )
161
+ if ! ok {
162
+ return nil , errors .New ("Failed to get the sast settings" )
163
+ }
156
164
157
165
if sastResponse == nil || ! ok {
158
166
return issues , errors .New ("Failed to get the sast settings" )
0 commit comments