Skip to content
Permalink
Browse files

sql: s/NewAssertionError/AssertionFailedf/

Fallout from fb8e85d.

Release note: None
  • Loading branch information...
nvanbenschoten committed Apr 22, 2019
1 parent 352bbb0 commit d03ad969722567e2acbec3ed7b9e61830f453966
@@ -103,7 +103,7 @@ func NewAssertionErrorWithWrappedErrf(err error, format string, args ...interfac
// NewInternalTrackingError instantiates an error
// meant for use with telemetry.ReportError directly.
//
// Do not use this! Convert uses to NewAssertionErrorf or similar
// Do not use this! Convert uses to AssertionFailedf or similar
// above.
func NewInternalTrackingError(issue int, detail string) *Error {
key := fmt.Sprintf("#%d.%s", issue, detail)
@@ -214,7 +214,7 @@ func (rgcq *replicaGCQueue) process(
//
// TODO(knz): we should really have a separate type for assertion
// errors that trigger telemetry, like
// pgerror.NewAssertionErrorf() does.
// pgerror.AssertionFailedf() does.
return errors.Errorf("expected 1 range descriptor, got %d", len(rs))
}
replyDesc := rs[0]
@@ -436,7 +436,7 @@ func TestLint(t *testing.T) {
}

if err := stream.ForEach(filter, func(s string) {
t.Errorf("\n%s <- forbidden; use panic(pgerror.NewAssertionErrorf()) instead", s)
t.Errorf("\n%s <- forbidden; use panic(pgerror.AssertionFailedf()) instead", s)
}); err != nil {
t.Error(err)
}
@@ -466,7 +466,7 @@ func TestLint(t *testing.T) {
}

if err := stream.ForEach(filter, func(s string) {
t.Errorf("\n%s <- forbidden; use pgerror.NewAssertionErrorf() instead", s)
t.Errorf("\n%s <- forbidden; use pgerror.AssertionFailedf() instead", s)
}); err != nil {
t.Error(err)
}
@@ -1324,9 +1324,9 @@ func TestLint(t *testing.T) {
"Info",
"Infof",
"InfofDepth",
"NewAssertionErrorWithDepthf",
"AssertionFailedf",
"AssertionFailedWithDepthf",
"NewAssertionErrorWithWrappedErrf",
"NewAssertionErrorf",
"DangerousStatementf",
"pgerror.New",
"pgerror.NewWithDepthf",

0 comments on commit d03ad96

Please sign in to comment.
You can’t perform that action at this time.