Skip to content

Commit bf837cb

Browse files
committed
reworded error messages to match style guide
1 parent 677cf9f commit bf837cb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

path-compression/path_compresssion.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func CompressPathToFile(pathToCompress string, enforceMaxFileSizeLimit bool) (st
7878
// Create output file
7979
outFile, err := os.Create(compressedFilePath)
8080
if err != nil {
81-
return "", 0, nil, stacktrace.Propagate(err, "Failed to create output file '%s'.", compressedFilePath)
81+
return "", 0, nil, stacktrace.Propagate(err, "An error occurred when creating the output file '%s'.", compressedFilePath)
8282
}
8383
defer outFile.Close()
8484

@@ -102,18 +102,18 @@ func CompressPathToFile(pathToCompress string, enforceMaxFileSizeLimit bool) (st
102102
// Create files from disk with default options
103103
files, err := archives.FilesFromDisk(ctx, nil, filenameMappings)
104104
if err != nil {
105-
return "", 0, nil, stacktrace.Propagate(err, "Failed to create files list for archive from '%s'.", pathToCompress)
105+
return "", 0, nil, stacktrace.Propagate(err, "An error occurred when creating files list for archive from '%s'.", pathToCompress)
106106
}
107107

108108
// Create the archive
109109
if err = format.Archive(ctx, outFile, files); err != nil {
110-
return "", 0, nil, stacktrace.Propagate(err, "Failed to compress '%s'.", pathToCompress)
110+
return "", 0, nil, stacktrace.Propagate(err, "An error occurred when compressing '%s'.", pathToCompress)
111111
}
112112

113113
compressedFileInfo, err := os.Stat(compressedFilePath)
114114
if err != nil {
115115
return "", 0, nil, stacktrace.Propagate(err,
116-
"Failed to inspect temporary archive file at '%s' during files upload for '%s'.",
116+
"An error occurred when inspecting the temporary archive file at '%s' during files upload for '%s'.",
117117
tempDir, pathToCompress)
118118
}
119119

@@ -122,7 +122,7 @@ func CompressPathToFile(pathToCompress string, enforceMaxFileSizeLimit bool) (st
122122
compressedFileSize = uint64(compressedFileInfo.Size())
123123
} else {
124124
return "", 0, nil, stacktrace.Propagate(err,
125-
"Failed to compute archive size for temporary file '%s' obtained compressing path '%s'",
125+
"An error occurred when computing the archive size for the temporary file '%s' obtained compressing path '%s'",
126126
tempDir, pathToCompress)
127127
}
128128

0 commit comments

Comments
 (0)