-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Telemetry] Bug in trackException() where data is undefined #14184
Copy link
Copy link
Closed
Description
Problem Description
In #14146, trackException() throws an exception as data is undefined, in reference to this part of the function:
// Copy miscellaneous system error fields into the codedError.data object
const syscallExceptionFieldsToCopy = ['errno', 'syscall', 'code'];
for (const f of syscallExceptionFieldsToCopy) {
if ((error as any)[f]) {
codedErrorStruct.data.codedError.data[f] = (error as any)[f]; // This throws the exception.
}
}
Steps To Reproduce
Needs to introduce a unit test, initially looking for codedError.data to be {} (see codedErrorStruct definition).
Expected Results
trackException() should not throw.
CLI version
15.0.1
Environment
See #14146Community Modules
No response
Target Platform Version
None
Target Device(s)
No response
Visual Studio Version
None
Build Configuration
None
Snack, code example, screenshot, or link to a repository
No response
Reactions are currently unavailable