mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-13 21:24:58 +08:00
1e34a2e33b
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 |
||
---|---|---|
.. | ||
autolinker.es6 | ||
autoscale-images.es6 | ||
email-frame-styles-store.coffee | ||
email-frame.jsx | ||
find-in-thread.jsx | ||
inline-download-prompts.es6 | ||
main.cjsx | ||
message-controls.cjsx | ||
message-item-body.cjsx | ||
message-item-container.cjsx | ||
message-item.cjsx | ||
message-list-hidden-messages-toggle.jsx | ||
message-list.cjsx | ||
message-participants.cjsx | ||
message-timestamp.jsx | ||
sidebar-participant-picker.jsx | ||
sidebar-plugin-container.cjsx | ||
thread-archive-button.cjsx | ||
thread-star-button.cjsx | ||
thread-toggle-unread-button.cjsx | ||
thread-trash-button.cjsx |