Javascript
비동기(Promise then) 사용시 try..catch..와 혼용하지 말것
아침엔커피한잔
2020. 5. 6. 00:29
Catching Errors in JavaScript Promises with a First Level try ... catch
So, I want my first level catch to be the one that handles the error. Is there anyway to propagate my error up to that first catch? Reference code, not working (yet): Promise = require('./framework/
stackoverflow.com
try {
asyncwork().then(() => {
}).catch(e => {
throw e -> throwing not working
})
} catch (e) {
console.error(e) => not work
}