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

Improve error message when env vars such as CNB_TARGET_OS are not set #803

Open
edmorley opened this issue Feb 29, 2024 · 0 comments
Open
Labels
enhancement New feature or request libcnb

Comments

@edmorley
Copy link
Member

In heroku/buildpacks-procfile#214 the buildpack failed with the following error message:

step-build-and-push [Error: Internal Buildpack Error]
step-build-and-push Couldn't determine target os: environment variable not found
step-build-and-push err:  heroku/procfile@3.0.0 (1)
step-build-and-push ======== Output: heroku/procfile@3.0.0 ========

This was due to the CNB_TARGET_OS env var not being set correctly (when Buildpack API 0.10 says it should), however, we could improve the error message to include the env var name to make such scenarios easier to debug.

#[error("Couldn't determine target os: {0}")]
CannotDetermineTargetOs(std::env::VarError),
#[error("Couldn't determine target arch: {0}")]
CannotDetermineTargetArch(std::env::VarError),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request libcnb
Projects
None yet
Development

No branches or pull requests

1 participant