Skip to content

Commit 3711fe1

Browse files
Merge pull request #9 from istreamlabs/recorder-test-error
Make recorder error message more useful
2 parents 640908c + d099f63 commit 3711fe1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77
## [Unreleased]
88
- Put unreleased items here.
99

10+
## [1.3.1] - 2018-05-14
11+
12+
- Add more helpful error message when `WithTest(t)` is not called on the recorder metrics client during testing.
13+
1014
## [1.3.0] - 2018-03-19
1115

1216
- Add `WithRate(float64)` to the metrics interface and to all clients that implement

metrics/recorder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ func (c *RecorderClient) Length() int {
265265
// output message to help with debugging.
266266
func (c *RecorderClient) Fatalf(format string, args ...interface{}) {
267267
if c.test == nil {
268-
panic("No test associated with metrics recorder")
268+
panic("No test associated with metrics recorder, you must call `recorder.WithTest(t)`")
269269
}
270270
// blacklist contains a set of fully qualified function name components that
271271
// we will filter out to keep the call stack concise.

0 commit comments

Comments
 (0)