-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patherrors.go
More file actions
50 lines (42 loc) · 2.38 KB
/
errors.go
File metadata and controls
50 lines (42 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package errorconstants
import "fmt"
// HTTP Errors
const (
StatusUnauthorized = "you are not authorized to make this request"
StatusForbidden = "you are not allowed to make this request"
RedirectURLNotFound = "redirect URL not found in response"
HTTPMethodNotFound = "HTTP method not found in request"
StatusInternalServerError = "an error occurred during this request"
)
const (
ApplicationDoesntExistOrNoPermission = "provided application does not exist or user has no permission to the application"
ImportFilePathIsRequired = "importFilePath is required"
ProjectNameIsRequired = "project name is required"
ProjectNotExists = "the project name you provided does not match any project"
ScanIDRequired = "scan ID is required"
FailedToGetApplication = "failed to get application"
SarifInvalidFileExtension = "Invalid file extension. Supported extensions are .sarif and .zip containing sarif files."
ImportSarifFileError = "There was a problem importing the SARIF file. Please contact support for further details."
ImportSarifFileErrorMessageWithMessage = "There was a problem importing the SARIF file. Please contact support for further details with the following error code: %d %s"
NoASCALicense = "User doesn't have \"AI Protection\" or \"Checkmarx One Assist\" license"
FailedUploadFileMsgWithDomain = "Unable to upload the file to the pre-signed URL. Try adding the domain: %s to your allow list."
FailedUploadFileMsgWithURL = "Unable to upload the file to the pre-signed URL. Try adding the URL: %s to your allow list."
// asca Engine
FileExtensionIsRequired = "file must have an extension"
// Realtime
RealtimeEngineErrFormat = "realtime engine error: %s"
RealtimeEngineNotAvailable = "Realtime engine is not available for this tenant"
RealtimeEngineFilePathRequired = "file path is required for realtime scan"
NoPermissionToUpdateApplication = "you do not have permission to update the application"
)
type RealtimeEngineError struct {
Message string
}
func (e *RealtimeEngineError) Error() error {
return fmt.Errorf(RealtimeEngineErrFormat, e.Message)
}
func NewRealtimeEngineError(message string) *RealtimeEngineError {
return &RealtimeEngineError{
Message: message,
}
}