From 586135170c4f0622f14871b739706803d192a65f Mon Sep 17 00:00:00 2001 From: ofluffydev Date: Fri, 25 Oct 2024 08:59:06 -0500 Subject: [PATCH] updated errors.New usages --- lib/main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/main.go b/lib/main.go index 30d13be..de8cc47 100644 --- a/lib/main.go +++ b/lib/main.go @@ -120,6 +120,8 @@ var ErrBuildEPKTargetRootError = errors.New("error creating target root") var ErrBuildEPKExecutingBuildShError = errors.New("error executing build.sh") var ErrBuildEPKCountingFilesError = errors.New("error counting files") 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 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, 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", 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{