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: update stdout() stderr() error message #173

Merged
merged 1 commit into from
Sep 5, 2023
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 mod.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Deno.test("should not get stderr when inherited only (default)", async () => {
assertThrows(
() => output.stderr,
Error,
`Stderr was not piped (was inherit). Call .stderr("piped") or .stderr("capture") when building the command.`,
`Stderr was not piped (was inherit). Call .stderr("piped") or .stderr("inheritPiped") when building the command.`,
);
});

Expand All @@ -63,7 +63,7 @@ Deno.test("should not get stderr when null", async () => {
assertThrows(
() => output.stderr,
Error,
`Stderr was not piped (was null). Call .stderr("piped") or .stderr("capture") when building the command.`,
`Stderr was not piped (was null). Call .stderr("piped") or .stderr("inheritPiped") when building the command.`,
);
});

Expand Down
4 changes: 2 additions & 2 deletions src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ export class CommandResult {
}
if (typeof this.#stdout === "string") {
throw new Error(
`Stdout was not piped (was ${this.#stdout}). Call .stdout("piped") or .stdout("capture") when building the command.`,
`Stdout was not piped (was ${this.#stdout}). Call .stdout("piped") or .stdout("inheritPiped") when building the command.`,
);
}
return this.#stdout.bytes({ copy: false });
Expand Down Expand Up @@ -827,7 +827,7 @@ export class CommandResult {
}
if (typeof this.#stderr === "string") {
throw new Error(
`Stderr was not piped (was ${this.#stderr}). Call .stderr("piped") or .stderr("capture") when building the command.`,
`Stderr was not piped (was ${this.#stderr}). Call .stderr("piped") or .stderr("inheritPiped") when building the command.`,
);
}
return this.#stderr.bytes({ copy: false });
Expand Down