forked from peterebden/ar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.go
More file actions
44 lines (35 loc) · 1.09 KB
/
error.go
File metadata and controls
44 lines (35 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package ar
import (
"errors"
"fmt"
)
var (
// ErrMissingGlobalHeader indicates that the archive file is invalid because its global
// header is missing (i.e., because the file is shorter than 8 bytes).
ErrMissingGlobalHeader = errors.New("ar: missing global header")
// ErrInvalidGlobalHeader indicates that the archive file is invalid because its global
// header is malformed (i.e., not the string "!<arch>\n").
ErrInvalidGlobalHeader = errors.New("ar: invalid global header")
)
// ErrStringTable indicates a problem with the string table in archives that use the GNU variant of
// the file format.
type ErrStringTable struct {
Err error
}
func (e *ErrStringTable) Error() string {
return fmt.Sprintf("ar: string table: %s", e.Err)
}
func (e *ErrStringTable) Unwrap() error {
return e.Err
}
// ErrFileName indicates a problem with the file name in one of the archive's file headers.
type ErrFileName struct {
Name string
Err error
}
func (e *ErrFileName) Error() string {
return fmt.Sprintf("ar: archive member '%s': %s", e.Name, e.Err)
}
func (e *ErrFileName) Unwrap() error {
return e.Err
}