Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions buildpacks/nodejs-npm-engine/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fn on_npm_install_error(error: NpmInstallError) -> ErrorMessage {

NpmInstallError::OpenTarball(path, e) => error_message()
.error_type(UserFacing(SuggestRetryBuild::Yes, SuggestSubmitIssue::Yes))
.header(format!("Failed to opening the downloaded {npm} package file"))
.header(format!("Failed to open the downloaded {npm} package file"))
.body(formatdoc! {"
An unexpected I/O occurred while opening the downloaded {npm} package file at {path}.
", path = file_value(path) })
Expand All @@ -125,7 +125,7 @@ fn on_npm_install_error(error: NpmInstallError) -> ErrorMessage {
.error_type(UserFacing(SuggestRetryBuild::Yes, SuggestSubmitIssue::Yes))
.header(format!("Failed to extract {npm} package file"))
.body(formatdoc! {"
An unexpected I/O occurred while extracing the contents of the downloaded {npm} package file at {path}.
An unexpected I/O occurred while extracting the contents of the downloaded {npm} package file at {path}.
", path = file_value(path) })
.debug_info(e.to_string())
.create(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ source: buildpacks/nodejs-npm-engine/src/errors.rs

! Failed to extract `npm` package file
!
! An unexpected I/O occurred while extracing the contents of the downloaded `npm` package file at `/layers/npm/install/npm.tgz`.
! An unexpected I/O occurred while extracting the contents of the downloaded `npm` package file at `/layers/npm/install/npm.tgz`.
!
! Use the debug information above to troubleshoot and retry your build.
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source: buildpacks/nodejs-npm-engine/src/errors.rs
- Debug Info:
- Invalid permissions

! Failed to opening the downloaded `npm` package file
! Failed to open the downloaded `npm` package file
!
! An unexpected I/O occurred while opening the downloaded `npm` package file at `/layers/npm/install/npm.tgz`.
!
Expand Down
8 changes: 5 additions & 3 deletions buildpacks/nodejs-npm-install/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,17 @@ fn on_buildpack_error(error: NpmInstallBuildpackError) -> ErrorMessage {
fn on_node_build_scripts_metadata_error(error: NodeBuildScriptsMetadataError) -> ErrorMessage {
let NodeBuildScriptsMetadataError::InvalidEnabledValue(value) = error;
let value_type = value.type_str();
let requires_metadata = style::value("[requires.metadata]");
let buildplan_name = style::value(NODE_BUILD_SCRIPTS_BUILD_PLAN_NAME);
error_message()
.error_type(ErrorType::UserFacing(
SuggestRetryBuild::No,
SuggestSubmitIssue::Yes,
))
.header("Invalid build script metadata")
.header("Invalid build plan metadata")
.body(formatdoc! { "
A participating buildpack has set invalid `[requires.metadata]` for the build plan \
named `{NODE_BUILD_SCRIPTS_BUILD_PLAN_NAME}`.
A participating buildpack has set invalid {requires_metadata} for the build plan \
named {buildplan_name}.

Expected metadata format:
[requires.metadata]
Expand Down
2 changes: 1 addition & 1 deletion buildpacks/nodejs-npm-install/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl Buildpack for NpmInstallBuildpack {

fn on_error(&self, error: libcnb::Error<Self::Error>) {
let error_message = errors::on_error(error);
eprintln!("{error_message}");
eprintln!("\n{error_message}");
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
source: buildpacks/nodejs-npm-install/src/errors.rs
---
! Invalid build script metadata
! Invalid build plan metadata
!
! A participating buildpack has set invalid `[requires.metadata]` for the build plan named `node_build_scripts`.
!
Expand Down