Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inside promise, errors are not being displaying in the console #95

Open
isaacking5 opened this issue Oct 18, 2021 · 1 comment
Open

Comments

@isaacking5
Copy link

isaacking5 commented Oct 18, 2021

Description

When I am trying to see the error logs which occur in promise, but in console-feed no errors are being displayed though
those errors appear in a browser console. But the with the same code which is outside the promise those errors are displaying in console-feed console.

code without promise

console.log("test".includ('test'))

above code WORKING AS EXPECTED, but

code inside the promise

new Promise((resolve) => {
  resolve();
}).then(() => stringIncludesTest());

function stringIncludesTest() {
  let dummyString = "test";
  console.log(dummyString.incldes("st"));
}

EXPECTED
Error should be display as :- ""a.incldes is not a function""

ACTUAL
Nothing is in console

NOTE : Browser console showing appropriate errors

@isaacking5 isaacking5 changed the title Inside promise, errors are not displaying in the console Inside promise, errors are not being displaying in the console Oct 18, 2021
@StephenGrider
Copy link

One possible workaround is to capture the event generated by the unhandledrejcetion and manually log the error. Example:

window.addEventListener('unhandledrejection', (e: any) => {
  console.error(e.reason);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants