updated errors.New usages

This commit is contained in:
Kaden Frisk 2024-10-25 08:59:06 -05:00
parent 0197437074
commit 586135170c

View file

@ -120,6 +120,8 @@ var ErrBuildEPKTargetRootError = errors.New("error creating target root")
var ErrBuildEPKExecutingBuildShError = errors.New("error executing build.sh") var ErrBuildEPKExecutingBuildShError = errors.New("error executing build.sh")
var ErrBuildEPKCountingFilesError = errors.New("error counting files") var ErrBuildEPKCountingFilesError = errors.New("error counting files")
var ErrBuildEPKBadBuildType = errors.New("bad build type") var ErrBuildEPKBadBuildType = errors.New("bad build type")
var ErrBuildEPKDirectoryDoesNotExist = errors.New("required directory does not exist")
var ErrBubbleWrapInsufficientPermissions = errors.New("bwrap does not have the necessary permissions")
// BuildEPK builds the EPK package into a build directory // BuildEPK builds the EPK package into a build directory
func BuildEPK(projectDir string, inMemory bool, buildConfig Build, logger *Logger) (int64, string, error, error) { func BuildEPK(projectDir string, inMemory bool, buildConfig Build, logger *Logger) (int64, string, error, error) {
@ -226,7 +228,7 @@ func BuildEPK(projectDir string, inMemory bool, buildConfig Build, logger *Logge
Content: "Directory does not exist: " + dir, Content: "Directory does not exist: " + dir,
Prompt: false, Prompt: false,
}) })
return 0, tempDir, err, errors.New("required directory does not exist: " + dir) return 0, tempDir, err, ErrBuildEPKDirectoryDoesNotExist
} }
} }
@ -254,7 +256,7 @@ func BuildEPK(projectDir string, inMemory bool, buildConfig Build, logger *Logge
Content: "bwrap is not available or does not have the necessary permissions", Content: "bwrap is not available or does not have the necessary permissions",
Prompt: false, Prompt: false,
}) })
return 0, tempDir, err, errors.New("bwrap is not available or does not have the necessary permissions") return 0, tempDir, err, ErrBubbleWrapInsufficientPermissions
} }
arguments := []string{ arguments := []string{