chore(all): review error wrappings
- remove repetitive `cannot` and `failed` prefixes - rename `unmarshaling` to `decoding`
This commit is contained in:
@@ -22,18 +22,18 @@ func (t *Tun) Create(path string) error {
|
||||
dev := unix.Mkdev(major, minor)
|
||||
err := t.mknod(path, unix.S_IFCHR, int(dev))
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot create TUN device file node: %w", err)
|
||||
return fmt.Errorf("creating TUN device file node: %w", err)
|
||||
}
|
||||
|
||||
fd, err := unix.Open(path, 0, 0)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot Unix Open TUN device file: %w", err)
|
||||
return fmt.Errorf("unix opening TUN device file: %w", err)
|
||||
}
|
||||
|
||||
const nonBlocking = true
|
||||
err = unix.SetNonblock(fd, nonBlocking)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot set non block to TUN device file descriptor: %w", err)
|
||||
return fmt.Errorf("setting non block to TUN device file descriptor: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user