Skip to content
Draft
Changes from 1 commit
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
7 changes: 6 additions & 1 deletion src/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,12 @@ export async function deploy(
);
} else {
clack.log.error(
wrapAnsi(`Could not create project: ${error instanceof Error ? error.message : error}`, effects.outputColumns)
wrapAnsi(
`Could not create project: ${
(error as any)?.statusCode === 409 ? "conflicting slug." : error instanceof Error ? error.message : error
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type safe version of this would be something like

if (isErrorMessage(error) && error.statusCode === 409 ...

This is probably fine as is.

}`,
effects.outputColumns
)
);
}
clack.outro(yellow("Deploy canceled"));
Expand Down