We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
e.stack?.split()
1 parent 716f00b commit 7454693Copy full SHA for 7454693
lib/logging/index.js
@@ -122,7 +122,8 @@ module.exports = resource => {
122
attributes['exception.stacktrace'] = e.stack
123
attributes['exception.type'] = e.name
124
// remove stack from message, if present
125
- log.msg = log.msg.replace(e.stack, e.stack.split('\n')[0])
+ // NOTE: an error should always have a stack, but there was an issue report where it somehow was undefined
126
+ log.msg = log.msg.replace(e.stack, e.stack?.split('\n')[0])
127
}
128
for (const field of custom_fields) if (field in log) attributes[field] = log[field]
129
logger.emit({
0 commit comments