Files
freeCodeCamp/guide/russian/javascript/standard-objects/promise/promise-reject/index.md
2018-10-16 21:32:40 +05:30

22 lines
751 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Promise Reject
localeTitle: Promise Reject
---
## Promise Reject
Функция `Promise.reject` возвращает условие ошибки вызывающей функции. В качестве причины отклонения требуется один параметр, объект или значение ошибки.
Объединение функции catch в конце вызывающего абонента Promise позволит вам уловить условие ошибки.
```javascript
promiseCallingFunction(paramList)
.then( ... )
...
.then( ... )
.catch( function(err) { // catch function
/*
* this is where you can access the reason for the rejection
*/
});
```