Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return full error context from ContextualError.Error() #1069

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

brad-defined
Copy link
Collaborator

Fix #1068 to provide more information from the Error() method of ContextualError objects.

I manually tested to force inject an error and context into Nebula, and printed the error from a client program.

With this change, a full error message is output:
WARN[2024-01-30T11:43:05-05:00] Failed to initialize Nebula error="failed to start nebula: Failed to get a tun/tap device due to manufactured error (map[]): lol wat"

Without this change, only the underlying error is output:
WARN[2024-01-30T11:43:30-05:00] Failed to initialize Nebula error="failed to start nebula: lol wat"

I'm on the fence wrt the extra fields.

@wadey wadey added this to the v1.9.0 milestone Jan 31, 2024
@brad-defined brad-defined merged commit e3f5a12 into master Jan 31, 2024
7 checks passed
@brad-defined brad-defined deleted the context-error branch January 31, 2024 20:31
@wadey wadey mentioned this pull request May 6, 2024
28 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 BUG: ContextualError wrapped errors ironically drop error context
2 participants