Improve segment error messages
@@ -130,8 +130,10 @@ func StartSegment(t *TxnData, now time.Time) SegmentStartTime {
}
var (
- errMalformedSegment = errors.New("segment identifier is malformed")
- errSegmentOrder = errors.New("segment identifier indicates out of order use")
+ errMalformedSegment = errors.New("segment identifier malformed: perhaps unsafe code has modified it?")
+ errSegmentOrder = errors.New(`improper segment use: the Transaction must be used ` +
+ `in a single goroutine and segments must be ended in "last started first ended" order: ` +
+ `see https://github.com/newrelic/go-agent/blob/master/GUIDE.md#segments`)
)
func endSegment(t *TxnData, start SegmentStartTime, now time.Time) (segmentEnd, error) {
