Browse Source

lib/util: Remove duplicate error handling code (#7299)

This is also in lib/svcutil, and never used by clients.

Co-authored-by: greatroar <@>
greatroar 4 years ago
parent
commit
6da83ac9f5
1 changed files with 0 additions and 44 deletions
  1. 0 44
      lib/util/utils.go

+ 0 - 44
lib/util/utils.go

@@ -15,8 +15,6 @@ import (
 	"strconv"
 	"strings"
 	"time"
-
-	"github.com/thejerf/suture/v4"
 )
 
 type defaultParser interface {
@@ -252,48 +250,6 @@ func AddressUnspecifiedLess(a, b net.Addr) bool {
 	return aIsUnspecified
 }
 
-type FatalErr struct {
-	Err    error
-	Status ExitStatus
-}
-
-func (e *FatalErr) Error() string {
-	return e.Err.Error()
-}
-
-func (e *FatalErr) Unwrap() error {
-	return e.Err
-}
-
-func (e *FatalErr) Is(target error) bool {
-	return target == suture.ErrTerminateSupervisorTree
-}
-
-// NoRestartErr wraps the given error err (which may be nil) to make sure that
-// `errors.Is(err, suture.ErrDoNotRestart) == true`.
-func NoRestartErr(err error) error {
-	if err == nil {
-		return suture.ErrDoNotRestart
-	}
-	return &noRestartErr{err}
-}
-
-type noRestartErr struct {
-	err error
-}
-
-func (e *noRestartErr) Error() string {
-	return e.err.Error()
-}
-
-func (e *noRestartErr) Unwrap() error {
-	return e.err
-}
-
-func (e *noRestartErr) Is(target error) bool {
-	return target == suture.ErrDoNotRestart
-}
-
 type ExitStatus int
 
 const (