1
0
Fork 0

Adding upstream version 3.5.1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-05-18 18:07:37 +02:00
parent e37d4622a7
commit 097626e61a
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
57 changed files with 6023 additions and 0 deletions

27
error.go Normal file
View file

@ -0,0 +1,27 @@
package archiver
import (
"fmt"
"strings"
)
// IllegalPathError is an error returned when an illegal
// path is detected during the archival process.
//
// By default, only the Filename is showed on error, but you might
// also get the absolute value of the invalid path on the AbsolutePath
// field.
type IllegalPathError struct {
AbsolutePath string
Filename string
}
func (err *IllegalPathError) Error() string {
return fmt.Sprintf("illegal file path: %s", err.Filename)
}
// IsIllegalPathError returns true if the provided error is of
// the type IllegalPathError.
func IsIllegalPathError(err error) bool {
return err != nil && strings.Contains(err.Error(), "illegal file path: ")
}