Could we capture the value of function args? #5581
Answered
by
AbhiPrasad
meotimdihia
asked this question in
Q&A
-
Could we capture the value of function args? For example: function test(a, b, c) {
if (a == 1) {
throw new Error("An error has occurred")
}
} I want to capture the value of variables: I read the documentation and can't find anything related to this. |
Beta Was this translation helpful? Give feedback.
Answered by
AbhiPrasad
Aug 15, 2022
Replies: 1 comment
-
Hey! As per #990, the JavaScript language itself (so browser, Node, etc.) does not support automatically capturing stack locals when capturing an error, like it does for python for example. For now, you can manually attach any function arguments using context, and attach them to events. For example: Sentry.setContext("testFunctionArgs", { a, b, c }); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
meotimdihia
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey! As per #990, the JavaScript language itself (so browser, Node, etc.) does not support automatically capturing stack locals when capturing an error, like it does for python for example.
For now, you can manually attach any function arguments using context, and attach them to events. For example: