Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
894 B

  1. # p-try [![Build Status](https://travis-ci.org/sindresorhus/p-try.svg?branch=master)](https://travis-ci.org/sindresorhus/p-try)
  2. > [`Promise#try()`](https://github.com/ljharb/proposal-promise-try) [ponyfill](https://ponyfill.com) - Starts a promise chain
  3. [How is it useful?](http://cryto.net/~joepie91/blog/2016/05/11/what-is-promise-try-and-why-does-it-matter/)
  4. ## Install
  5. ```
  6. $ npm install --save p-try
  7. ```
  8. ## Usage
  9. ```js
  10. const pTry = require('p-try');
  11. pTry(() => {
  12. return synchronousFunctionThatMightThrow();
  13. }).then(value => {
  14. console.log(value);
  15. }).catch(error => {
  16. console.error(error);
  17. });
  18. ```
  19. ## Related
  20. - [p-finally](https://github.com/sindresorhus/p-finally) - `Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome
  21. - [More…](https://github.com/sindresorhus/promise-fun)
  22. ## License
  23. MIT © [Sindre Sorhus](https://sindresorhus.com)