[Solved] How to use Notification addError?


I have an issue using Atom NotificationManager, I don’t know how to use the option object and since the documentation doesn’t give you an example.
I have to create an error Notification with a button that can be expanded/collapsed revelaing the real error message.
Please help!


You describe it like any other object.

atom.notifications.addSuccess("This works.", {
  buttons: [
    className: "btn-details",
    onDidClick: function() {},
    text: "Details"
  detail: "This is more stuff here."


Thanks, It’s finally working!
Anyway I think that atom docs have to improve, maybe with some examples?


The Atom documentation, like Atom itself, is open source. If you have some ideas for examples that you feel would be helpful to others, we’d love to take a look at a Pull Request adding them :grinning:


Where could I do a pull request for the docs?


Yes. If you’re talking about documentation on https://atom.io/docs/api/latest, you would submit a Pull Request to https://github.com/atom/atom. If you’re talking about documentation on http://flight-manual.atom.io, you would submit a Pull Request to https://github.com/atom/flight-manual.atom.io.


Is this part of the Atom Flight Manual?


No. The NotificationManager documentation is part of the API.


Is that editable?
Could I modify it with a pull request or something like that?


Yes, it’s right here. The API documentation is generated from the comments in the code.


I will try to improve the docs