No stack trace displayed in error notification


#1

I have the following code:

onDidClick: async function () {
	try {
		await project.addPeerPackage(package.name)
	} catch(error) {
		atom.notifications.addError(error.message, {
			stack: error.stack,
			dismissable: true,
		})
	}
	this.removeNotification();
},

Unfortunately I don’t see the “show stack trace” link:

When I log the stack, I of course correctly have one.

Any idea?


#2

I just found the solution: give a value for the detail option:

onDidClick: async function () {
	try {
		await project.addPeerPackage(package.name)
	} catch(error) {
		atom.notifications.addError('Unable to add peer package.', {
			stack: error.stack,
			detail: error.message,
			dismissable: true,
		})
	}
	this.removeNotification();
},

Here is the result :tada: