You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/11-async/04-promise-error-handling/article.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -140,7 +140,7 @@ new Promise((resolve, reject) => {
140
140
}
141
141
142
142
}).then(function() {
143
-
/* doesn't runs here */
143
+
/* doesn't run here */
144
144
}).catch(error=> { // (**)
145
145
146
146
alert(`The unknown error has occurred: ${error}`);
@@ -166,7 +166,7 @@ new Promise(function() {
166
166
167
167
In case of an error, the promise becomes rejected, and the execution should jump to the closest rejection handler. But there is none. So the error gets "stuck". There's no code to handle it.
168
168
169
-
In practice, just like with a regular unhandled errors in code, it means that something has terribly gone wrong.
169
+
In practice, just like with regular unhandled errors in code, it means that something has terribly gone wrong.
170
170
171
171
What happens when a regular error occurs and is not caught by `try..catch`? The script dies with a message in console. Similar thing happens with unhandled promise rejections.
0 commit comments