Better error handling for access to denylist files

This commit is contained in:
Dane Everitt
2021-01-10 16:43:33 -08:00
parent 2c1b211280
commit b10e4dd437
2 changed files with 15 additions and 9 deletions

View File

@@ -35,7 +35,11 @@ func (e *Error) Error() string {
case ErrCodeUnknownArchive:
return "filesystem: unknown archive format"
case ErrCodeDenylistFile:
return "filesystem: file access prohibited: denylist"
r := e.resolved
if r == "" {
r = "<empty>"
}
return fmt.Sprintf("filesystem: file access prohibited: [%s] is on the denylist", r)
case ErrCodePathResolution:
r := e.resolved
if r == "" {