Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

exchanger: Improve ErrorLogging #303

Merged
merged 1 commit into from
Oct 6, 2015
Merged

Conversation

tsenart
Copy link
Contributor

@tsenart tsenart commented Oct 6, 2015

While debugging #297 and #298, it became apparent that this extra
information would be very useful in aiding understanding of the issue.

@tsenart tsenart added this to the v1.0.0 milestone Oct 6, 2015
@tsenart tsenart added the WIP label Oct 6, 2015
@tsenart tsenart force-pushed the exchanger-better-error-logs branch from 5b7c99e to 442000b Compare October 6, 2015 13:27
@@ -61,7 +61,7 @@ func ErrorLogging(l *log.Logger) Decorator {
return Func(func(m *dns.Msg, a string) (r *dns.Msg, rtt time.Duration, err error) {
defer func() {
if err != nil {
l.Printf("error exchanging with %q: %v", a, err)
l.Printf("error exchanging %v with %q: %v", m.Question[0], a, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

m.Question is always non-nil and len(m)>1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, we may have no question, but it will never be nil.

While debugging #297 and #298, it became apparent that this extra
information would be very useful in aiding understanding of the issue.
@tsenart tsenart force-pushed the exchanger-better-error-logs branch from 442000b to cdccd03 Compare October 6, 2015 17:00
@tsenart tsenart added PTAL and removed WIP labels Oct 6, 2015
tsenart added a commit that referenced this pull request Oct 6, 2015
@tsenart tsenart merged commit 54854aa into master Oct 6, 2015
@tsenart tsenart removed the PTAL label Oct 6, 2015
@tsenart tsenart deleted the exchanger-better-error-logs branch October 6, 2015 17:06
@tsenart tsenart mentioned this pull request Oct 9, 2015
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants