Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

internal/agent: slightly improve Normalize output #553

Merged
merged 1 commit into from Jan 3, 2019
Merged

Conversation

gbbr
Copy link
Contributor

@gbbr gbbr commented Jan 3, 2019

Slightly improves error messages, making them more consistent and in some cases more explicit.

@gbbr gbbr added this to the 6.9.0 milestone Jan 3, 2019
@gbbr gbbr merged commit 20aba17 into master Jan 3, 2019
@gbbr gbbr deleted the gbbr/normalize branch January 3, 2019 16:51
}

// If the end date is too far away in the future, it's probably a mistake.
if s.Start+s.Duration > time.Now().Add(MaxEndDateOffset).UnixNano() {
return fmt.Errorf("span.normalize: more than %v in the future", MaxEndDateOffset)
return fmt.Errorf("invalid `Start`+`Duration`: too far in the future")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we include the value of the invalid end date in the message? My experience is that makes debugging much easier, and I think that's the error message pattern you're using elsewhere :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, too late now, but will do as a follow up.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants