Skip to content

Commit f8557e2

Browse files
author
cx-Margarita-LevitM
committed
Fix bug number AST-115497
1 parent a246d9e commit f8557e2

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

internal/constants/errors/errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ const (
2727
NoPermissionToUpdateApplication = "you do not have permission to update the application"
2828
FailedToUpdateApplication = "failed to update application"
2929
ApplicationNotFound = "Application not found"
30+
ErrMissingAIFeatureLicense = "User does not have the required license for AI-assisted functionality."
3031

31-
// asca Engine
3232
FileExtensionIsRequired = "file must have an extension"
3333

3434
// Realtime

internal/services/realtimeengine/common.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package realtimeengine
33
import (
44
"os"
55

6+
errorconstants "github.com/checkmarx/ast-cli/internal/constants/errors"
67
"github.com/checkmarx/ast-cli/internal/params"
78
"github.com/checkmarx/ast-cli/internal/wrappers"
89
"github.com/pkg/errors"
@@ -36,7 +37,7 @@ func EnsureLicense(jwtWrapper wrappers.JWTWrapper) error {
3637
if aiAllowed || assistAllowed {
3738
return nil
3839
}
39-
return errors.New("User has a valid license for AI Protection or Checkmarx One Assist")
40+
return errors.New(errorconstants.ErrMissingAIFeatureLicense)
4041
}
4142

4243
// ValidateFilePath validates that the file path exists and is accessible.

internal/services/realtimeengine/ossrealtime/oss-realtime.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func (o *OssRealtimeService) RunOssRealtimeScan(filePath, ignoredFilePath string
6161
}
6262

6363
if err := realtimeengine.EnsureLicense(o.JwtWrapper); err != nil {
64-
return nil, errorconstants.NewRealtimeEngineError("failed to ensure license").Error()
64+
return nil, errorconstants.NewRealtimeEngineError(err.Error()).Error()
6565
}
6666

6767
if err := realtimeengine.ValidateFilePath(filePath); err != nil {

0 commit comments

Comments
 (0)