Skip to content

Commit 362a0ce

Browse files
committed
Revert "serviceerror: add error checking helpers (#227)"
This reverts commit 981440d.
1 parent dc8b83b commit 362a0ce

28 files changed

+0
-223
lines changed

serviceerror/aborted.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package serviceerror
22

33
import (
4-
"errors"
54
"fmt"
65

76
"google.golang.org/grpc/codes"
@@ -48,10 +47,3 @@ func newAborted(st *status.Status) error {
4847
st: st,
4948
}
5049
}
51-
52-
// IsAborted returns whether any error in the provided error's chain is an
53-
// Aborted error.
54-
func IsAborted(err error) bool {
55-
var serr *Aborted
56-
return errors.As(err, &serr)
57-
}

serviceerror/already_exists.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package serviceerror
22

33
import (
4-
"errors"
54
"fmt"
65

76
"google.golang.org/grpc/codes"
@@ -54,10 +53,3 @@ func newAlreadyExists(st *status.Status) error {
5453
st: st,
5554
}
5655
}
57-
58-
// IsAlreadyExists returns whether any error in the provided error's chain is an
59-
// AlreadyExists error.
60-
func IsAlreadyExists(err error) bool {
61-
var serr *AlreadyExists
62-
return errors.As(err, &serr)
63-
}

serviceerror/canceled.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package serviceerror
22

33
import (
4-
"errors"
54
"fmt"
65

76
"google.golang.org/grpc/codes"
@@ -49,10 +48,3 @@ func newCanceled(st *status.Status) error {
4948
st: st,
5049
}
5150
}
52-
53-
// IsCanceled returns whether any error in the provided error's chain is a
54-
// Canceled error.
55-
func IsCanceled(err error) bool {
56-
var serr *Canceled
57-
return errors.As(err, &serr)
58-
}

serviceerror/cancellation_already_requested.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package serviceerror
22

33
import (
4-
"errors"
54
"fmt"
65

76
"google.golang.org/grpc/codes"
@@ -55,10 +54,3 @@ func newCancellationAlreadyRequested(st *status.Status) error {
5554
st: st,
5655
}
5756
}
58-
59-
// IsCancellationAlreadyRequested returns whether any error in the provided error's chain is a
60-
// CancellationAlreadyRequested error.
61-
func IsCancellationAlreadyRequested(err error) bool {
62-
var serr *CancellationAlreadyRequested
63-
return errors.As(err, &serr)
64-
}

serviceerror/client_version_not_supported.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package serviceerror
22

33
import (
4-
"errors"
54
"fmt"
65

76
"google.golang.org/grpc/codes"
@@ -71,10 +70,3 @@ func newClientVersionNotSupported(st *status.Status, errDetails *errordetails.Cl
7170
st: st,
7271
}
7372
}
74-
75-
// IsClientVersionNotSupported returns whether any error in the provided error's chain is a
76-
// ClientVersionNotSupported error.
77-
func IsClientVersionNotSupported(err error) bool {
78-
var serr *ClientVersionNotSupported
79-
return errors.As(err, &serr)
80-
}

serviceerror/data_loss.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package serviceerror
22

33
import (
4-
"errors"
54
"fmt"
65

76
"google.golang.org/grpc/codes"
@@ -49,10 +48,3 @@ func newDataLoss(st *status.Status) error {
4948
st: st,
5049
}
5150
}
52-
53-
// IsDataLoss returns whether any error in the provided error's chain is a
54-
// DataLoss error.
55-
func IsDataLoss(err error) bool {
56-
var serr *DataLoss
57-
return errors.As(err, &serr)
58-
}

serviceerror/deadline_exceeded.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package serviceerror
22

33
import (
4-
"errors"
54
"fmt"
65

76
"google.golang.org/grpc/codes"
@@ -49,10 +48,3 @@ func newDeadlineExceeded(st *status.Status) error {
4948
st: st,
5049
}
5150
}
52-
53-
// IsDeadlineExceeded returns whether any error in the provided error's chain is a
54-
// DeadlineExceeded error.
55-
func IsDeadlineExceeded(err error) bool {
56-
var serr *DeadlineExceeded
57-
return errors.As(err, &serr)
58-
}

serviceerror/failed_precondition.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package serviceerror
22

33
import (
4-
"errors"
54
"fmt"
65

76
"google.golang.org/grpc/codes"
@@ -49,10 +48,3 @@ func newFailedPrecondition(st *status.Status) error {
4948
st: st,
5049
}
5150
}
52-
53-
// IsFailedPrecondition returns whether any error in the provided error's chain is a
54-
// FailedPrecondition error.
55-
func IsFailedPrecondition(err error) bool {
56-
var serr *FailedPrecondition
57-
return errors.As(err, &serr)
58-
}

serviceerror/internal.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package serviceerror
22

33
import (
4-
"errors"
54
"fmt"
65

76
"google.golang.org/grpc/codes"
@@ -49,10 +48,3 @@ func newInternal(st *status.Status) error {
4948
st: st,
5049
}
5150
}
52-
53-
// IsInternal returns whether any error in the provided error's chain is an
54-
// Internal error.
55-
func IsInternal(err error) bool {
56-
var serr *Internal
57-
return errors.As(err, &serr)
58-
}

serviceerror/invalid_argument.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package serviceerror
22

33
import (
4-
"errors"
54
"fmt"
65

76
"google.golang.org/grpc/codes"
@@ -49,10 +48,3 @@ func newInvalidArgument(st *status.Status) error {
4948
st: st,
5049
}
5150
}
52-
53-
// IsInvalidArgument returns whether any error in the provided error's chain is an
54-
// InvalidArgument error.
55-
func IsInvalidArgument(err error) bool {
56-
var serr *InvalidArgument
57-
return errors.As(err, &serr)
58-
}

0 commit comments

Comments
 (0)