Mailspring/internal_packages/message-list/lib
Juan Tejada 1e34a2e33b 🎨 Fix unhandled api rejections/Prefer promises over success option for api requests
Summary:
This commit modifies the api of NylasAPIRequest to /not/ take `success`
or `error` callback options at all, and only returns a Promise which you
can `then` and `catch` to handle the api response.

The fact that it returned a promise, and /also/ took `success` and
`error` callback options made it really confusing to use.

Additionaly, when using the callbacks intead of a promise, any errors
would be unhandled and reported to Sentry because even though the `error`
callback was being passed, the promise returned by `run()` still rejected and
no one was handling that reject, so it reached the `unhandledRejection` event
listener. This is undesirable because if you passed an `error` callback, it
means that you intended to handle it.

An example of this is calling the clearbit API, which will more often than
not return a 404, and even though we had an error handler which ignored the 404,
it still unecessarilly reported to Sentry, flooding it with events

Test Plan: manually check all updated codepaths still work

Reviewers: halla, spang, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3869
2017-02-09 09:19:55 -08:00
..
autolinker.es6 feat(autolinker): linkify nylas: commands 2016-11-16 13:35:12 -08:00
autoscale-images.es6 fix(files): When download mode is “manual” prompt about inline attachments 2016-10-03 11:22:44 -07:00
email-frame-styles-store.coffee fix(dark-mode): Adjust email CSS immediately upon switching themes 2015-11-23 20:20:06 -08:00
email-frame.jsx fix(email-frame): Refactor if/else for frame height 2016-11-02 15:56:27 -07:00
find-in-thread.jsx fix(lint): final linter fixes 2016-05-06 16:32:34 -07:00
inline-download-prompts.es6 fix(inline-attachments): Handle images with UTF16 names 2016-11-15 17:04:43 -08:00
main.cjsx fix(thread-popout): Display the hidden message toggle in the thread-popout 2016-10-25 11:05:34 -07:00
message-controls.cjsx 🎨 Fix unhandled api rejections/Prefer promises over success option for api requests 2017-02-09 09:19:55 -08:00
message-item-body.cjsx fix(spinner): Use a constant spinner when loading inline images 2017-01-09 10:46:09 -08:00
message-item-container.cjsx fix(reminders): Add missing assets, ui cleanup, restore dead code 2016-11-01 11:39:50 -07:00
message-item.cjsx feat(attachments): Generate and display thumbnail previews for files (mac only) 2016-11-02 17:27:53 -07:00
message-list-hidden-messages-toggle.jsx fix(hidden-messages): Address diff feedback from @jstejada 2016-03-02 10:28:32 -08:00
message-list.cjsx fix(reminders): Add missing assets, ui cleanup, restore dead code 2016-11-01 11:39:50 -07:00
message-participants.cjsx fix(participants): When copying, include space #2871 2016-09-30 10:48:34 -07:00
message-timestamp.jsx lint(*): Bump to ESLint 3.8 2016-10-17 18:07:35 -07:00
sidebar-participant-picker.jsx fix(warning): Don't render participant picker with null value 2016-10-25 14:08:13 -07:00
sidebar-plugin-container.cjsx feat(sidebar): Add thread list of currently selected participants 2016-03-09 14:33:31 -05:00
thread-archive-button.cjsx feat(analytics): add analytics for change mail tasks 2017-01-24 12:22:33 -05:00
thread-star-button.cjsx feat(analytics): add analytics for change mail tasks 2017-01-24 12:22:33 -05:00
thread-toggle-unread-button.cjsx feat(analytics): add analytics for change mail tasks 2017-01-24 12:22:33 -05:00
thread-trash-button.cjsx feat(analytics): add analytics for change mail tasks 2017-01-24 12:22:33 -05:00