When calling requestContact() chained with .catch(e=>console.error(e)), it will still result in uncaught promise in error.
To Reproduce
Steps to reproduce the behavior:
useEffect(() => {
if (isTele) {
if (isAccessGranted) {
if (phoneRetrievalSupported) {
// request for phone number
requestContact()
.then((contact) => {
const {
contact: { phoneNumber },
} = contact;
teleFormObj.setValue("phoneNumber", phoneNumber);
})
.catch((e) => {
console.error("Some error", e);
// throw e;
});
}
} else if (isAccessGranted === false) {
if (miniApp) miniApp.close();
else redirect("/");
}
}
}, [isAccessGranted, router, isTele, phoneRetrievalSupported, teleFormObj]);
Expected Behavior
Error should be caught in the .catch and console.error to console. Instead, the console.error statement is not executed and results in an uncaught error in promise
Telegram Application
Telegram Desktop
Describe the Bug
When calling requestContact() chained with .catch(e=>console.error(e)), it will still result in uncaught promise in error.
To Reproduce
Steps to reproduce the behavior:
Expected Behavior
Error should be caught in the .catch and console.error to console. Instead, the console.error statement is not executed and results in an uncaught error in promise