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

Align fauna local error messaging casing with command argument casing for 'host-port' #561

Merged
merged 1 commit into from
Jan 15, 2025
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
6 changes: 3 additions & 3 deletions src/lib/docker-containers.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ async function findContainer({ containerName, hostPort }) {
if (diffPort) {
throw new CommandError(
`[FindContainer] Container '${containerName}' is already \
in use on hostPort '${diffPort.PublicPort}'. Please use a new name via \
arguments --name <newName> --hostPort ${hostPort} to start the container.`,
in use on host-port '${diffPort.PublicPort}'. Please use a new name via \
arguments --name <newName> --host-port ${hostPort} to start the container.`,
);
}
return result;
Expand Down Expand Up @@ -222,7 +222,7 @@ async function createContainer({
const occupied = await isPortOccupied({ hostIp, hostPort });
if (occupied) {
throw new CommandError(
`[StartContainer] The hostPort '${hostPort}' on IP '${hostIp}' is already occupied. \
`[StartContainer] The host-port '${hostPort}' on IP '${hostIp}' is already occupied. \
Please pass a --host-port other than '${hostPort}'.`,
);
}
Expand Down
6 changes: 3 additions & 3 deletions test/commands/local.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ describe("local command", () => {

// Assertions
expect(written).to.contain(
"[StartContainer] The hostPort '8443' on IP '0.0.0.0' is already occupied. \
"[StartContainer] The host-port '8443' on IP '0.0.0.0' is already occupied. \
Please pass a --host-port other than '8443'.",
);
expect(written).not.to.contain("fauna local");
Expand Down Expand Up @@ -567,8 +567,8 @@ https://support.fauna.com/hc/en-us/requests/new`,
expect(logsStub).not.to.have.been.called;
const written = stderrStream.getWritten();
expect(written).to.contain(
`[FindContainer] Container 'faunadb' is already in use on hostPort '9999'. \
Please use a new name via arguments --name <newName> --hostPort ${desiredPort} \
`[FindContainer] Container 'faunadb' is already in use on host-port '9999'. \
Please use a new name via arguments --name <newName> --host-port ${desiredPort} \
to start the container.`,
);
expect(written).not.to.contain("An unexpected");
Expand Down
Loading