Skip to content

Commit b19a60d

Browse files
committed
v2: remove errors that are never returned
Unlike v1, the v2 package never returns these errors. This patch removes them to prevent consumers of this package from assuming they may be returned, and writing special handling around them. NOTE: this is a breaking change, so (following SemVer) would require a major version update. However, consumers should not use these errors. Alternatively, we could "deprecate" them first. Making it a breaking change makes it more visible (compile time error), which may help consumers to find incorrect handling of these errors. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 616d434 commit b19a60d

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

v2/errors.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,8 @@ import (
2222
)
2323

2424
var (
25-
ErrInvalidPid = errors.New("cgroups: pid must be greater than 0")
26-
ErrMountPointNotExist = errors.New("cgroups: cgroup mountpoint does not exist")
27-
ErrInvalidFormat = errors.New("cgroups: parsing file with invalid format failed")
28-
ErrFreezerNotSupported = errors.New("cgroups: freezer cgroup (v2) not supported on this system")
29-
ErrMemoryNotSupported = errors.New("cgroups: memory cgroup (v2) not supported on this system")
30-
ErrPidsNotSupported = errors.New("cgroups: pids cgroup (v2) not supported on this system")
31-
ErrCPUNotSupported = errors.New("cgroups: cpu cgroup (v2) not supported on this system")
32-
ErrCgroupDeleted = errors.New("cgroups: cgroup deleted")
33-
ErrNoCgroupMountDestination = errors.New("cgroups: cannot find cgroup mount destination")
34-
ErrInvalidGroupPath = errors.New("cgroups: invalid group path")
25+
ErrInvalidFormat = errors.New("cgroups: parsing file with invalid format failed")
26+
ErrInvalidGroupPath = errors.New("cgroups: invalid group path")
3527
)
3628

3729
// ErrorHandler is a function that handles and acts on errors

0 commit comments

Comments
 (0)