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

Update apex/log handler for automatic linking of errors to routes #288

Merged
merged 1 commit into from
Jul 22, 2022

Conversation

chimanjain
Copy link
Contributor

@chimanjain chimanjain commented Jul 20, 2022

Update apex/log handler to check for a couple special fields i.e. route and httpMethod, and if present, move them from Notice.Params to Notice.Context for automatic linking of errors to routes.

Comment on lines 35 to 38
if key == "httpMethod" {
notice.Context["httpMethod"] = parameter
delete(parameters, "httpMethod")
}
if key == "route" {
notice.Context["route"] = parameter
delete(parameters, "route")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if key == "httpMethod" {
notice.Context["httpMethod"] = parameter
delete(parameters, "httpMethod")
}
if key == "route" {
notice.Context["route"] = parameter
delete(parameters, "route")
}
if key == "httpMethod" || key == "route" {
notice.Context[key] = parameter
delete(parameters, key)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This works better

@chimanjain chimanjain merged commit 945d83b into master Jul 22, 2022
@chimanjain chimanjain deleted the apexlog-update branch July 22, 2022 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants