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

fix: capture ProcessException when hook generation fails due to dart pub get #1242

Open
alestiago opened this issue Feb 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@alestiago
Copy link
Collaborator

alestiago commented Feb 5, 2024

Description

Running hooks using the Mason API throws a ProcessException if Dart executable is not installed.

Steps To Reproduce

  1. Run a Mason Generator:
final generator = await MasonGenerator.fromBundle(myBundle);
await generator.hooks.preGen(vars: {'name':'Dash'});
  1. See error:
ProcessException: No such file or directory
  Command: /bin/sh -c 'dart' 'pub' 'get'

Expected Behavior

I would expect the error to be captured, it is currently not being captured.

I would expect a better error message that outlined the issue comes from Mason itself (since it is running the dart pub get internally) with a verbose description on how to resolve.

Additional Context

@alestiago alestiago added the bug Something isn't working label Feb 5, 2024
@alestiago alestiago changed the title fix: fix: capture ProcessException when hook generation fails Feb 5, 2024
@alestiago alestiago changed the title fix: capture ProcessException when hook generation fails fix: capture ProcessException when hook generation fails due to dart pub get Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant