-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Description
Bug Report
🔎 Search Terms
promise promises catch method function any unknown useUnknownInCatchVariables
🕗 Version & Regression Information
All versions with flag, like 4.5.0, including 4.6.0-nightly
async function veryverynice() {
fetch('').catch(error => {
console.log(error)
})
try {
await fetch('')
} catch (error) {
console.log(error)
}
}⏯ Playground Link
4.6.0-nightly playground link with relevant code
💻 Code
async function veryverynice() {
fetch('').catch(error => { // any
console.log(error);
});
try {
await fetch('')
} catch (error) { // unknown
console.log(error);
}
}🙁 Actual behavior
error in promise.catch(error => {}) is of type any
🙂 Expected behavior
error in promise.catch(error => {}) is of type unknown
🍝 Related
Metadata
Metadata
Assignees
Labels
No labels