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

Error handling doesn't work for throw newError() in async function #1636

Closed
IvanNaumenko opened this issue Nov 13, 2017 · 0 comments
Closed

Comments

@IvanNaumenko
Copy link

IvanNaumenko commented Nov 13, 2017

Hey guys!

Hey guys, how to forward my mistake to ERROR?
throw new Error('some error');
but i need to get false in result

(async function () {
  try {   
    let staticD = tmp.leads.leadID,
      getBoolean = compare(staticD, myStr);
    if (getBoolean ===false) {
      console.log("kfs " + getBoolean);
      throw new Error('some error');

    }else {      
      console.log(`${'etalon'}`);
    }
  }catch (err){
    console.log(err);
  }
}) ()

image

@IvanNaumenko IvanNaumenko changed the title Error handling doesn't work for throw newError() Error handling doesn't work for throw newError() in async function Nov 13, 2017
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