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

Multiple catches does not work correctly in js #431

Open
BSteffaniak opened this issue Sep 7, 2022 · 0 comments
Open

Multiple catches does not work correctly in js #431

BSteffaniak opened this issue Sep 7, 2022 · 0 comments

Comments

@BSteffaniak
Copy link
Member

try {
  if (args.count < 2) {
    throw Exception("Missing command")
  }

  Airship(args.skip(1)):run()
} catch (FlatInstallationFailureException e) {
  log.error(e.message)
  System.exit(1)
} catch (Exception e) {
  log.error(e.message)
  external {
    console.error(#{e}.error);
  }
  System.exit(1)
}

produces:

try {
	if (args.accessor_count() < 2) {
		throw Exception.construct(FlatString.construct4("Missing command"));
	}
	(await Airship.construct2(args.skip(1)).__chainAsync('run', []));
} catch (e)  {
	if (!(e instanceof Exception)) {
		console.log(0.9890224985166168);
		console.error(e);
		process.exit(1);
	} else {
		Airship.log.error(e.message);
		System.exit0(1);
	}
	}
catch (e)  {
	if (!(e instanceof Exception)) {
		console.log(0.3028649297462579);
		console.error(e);
		process.exit(1);
	} else {
		Airship.log.error(e.message);
		console.error(e.error);
		System.exit0(1);
	}
	}
finally {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

1 participant