Mailspring/internal_packages/keybase/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
..
decrypt-button.cjsx fix(composer): Stop parsing quoted text on each keystroke to prevent composer lag 2016-07-21 11:11:14 -07:00
decryption-preprocess.coffee pgp-plugin update (#2534) 2016-07-08 11:29:10 -07:00
email-popover.cjsx Pgp patch (#2430) 2016-06-14 13:22:38 -07:00
encrypt-button.cjsx fix(analytics): Add pgp encryption events 2016-10-12 17:29:58 -04:00
identity.coffee feat(keybase): Adds PGP Encryption Plugin 2016-06-07 13:30:04 -07:00
key-adder.cjsx pgp-plugin update (#2534) 2016-07-08 11:29:10 -07:00
key-manager.cjsx pgp-plugin update (#2534) 2016-07-08 11:29:10 -07:00
keybase-search.cjsx 🎨 Fix unhandled api rejections/Prefer promises over success option for api requests 2017-02-09 09:19:55 -08:00
keybase-user.cjsx feat(keybase): Adds PGP Encryption Plugin 2016-06-07 13:30:04 -07:00
keybase.coffee feat(keybase): Adds PGP Encryption Plugin 2016-06-07 13:30:04 -07:00
main.es6 feat(keybase): Adds PGP Encryption Plugin 2016-06-07 13:30:04 -07:00
modal-key-recommender.cjsx fix(db): Return; preventing ThreadSearch indexing 2016-10-19 16:54:00 -07:00
passphrase-popover.cjsx fix(composer): Stop parsing quoted text on each keystroke to prevent composer lag 2016-07-21 11:11:14 -07:00
pgp-key-store.cjsx fix(analytics): Add pgp encryption events 2016-10-12 17:29:58 -04:00
preferences-keybase.cjsx fix(keybase): Add a small button to redeem a keybase invite 2016-06-13 17:40:21 -07:00
private-key-popover.cjsx fix(composer): Stop parsing quoted text on each keystroke to prevent composer lag 2016-07-21 11:11:14 -07:00
recipient-key-chip.cjsx feat(keybase): Adds PGP Encryption Plugin 2016-06-07 13:30:04 -07:00