Skip to content
This repository has been archived by the owner on Sep 22, 2024. It is now read-only.

Commit

Permalink
fix(cli): show deployment error message if any and stop process to av…
Browse files Browse the repository at this point in the history
…oid infinite wait
  • Loading branch information
miguelrk committed Jun 4, 2024
1 parent 43ad951 commit 7a8a38d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
7 changes: 3 additions & 4 deletions lib/cli/src/subcommands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,7 @@ async function deploy(
Deno.exit(1);
}

const { data: deployments } = await api.deployments.get<
Paginated<Deployment>
>({
const { data: deployments } = await api.deployments.get<Paginated<Deployment>>({
projectId: project.denoId,
});
if (!deployments) {
Expand Down Expand Up @@ -395,9 +393,10 @@ async function deploy(
},
);

const _denoDeployment = await api.deployments.post<Deployment>(data, {
const denoDeployment = await api.deployments.post<Deployment | { message: string }>(data, {
projectId: project._id,
});
if ("message" in denoDeployment) error(LOGS.deploymentError(denoDeployment.message));
} catch (err: unknown) {
if (err instanceof APIError) {
if (deploySpinner) {
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/netzolabs/islands/dialog-issues-create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function DialogIssuesCreate(props: {
options: [
{ value: "bug", label: "Reporte de error" },
{ value: "enhancement", label: "Solicitud de mejora" },
{ value: "feature", label: "Solicitud de nueva función" },
{ value: "feature", label: "Solicitud de nueva funcionalidad" },
{ value: "feedback", label: "Comentarios generales" },
{ value: "question", label: "Pregunta" },
],
Expand Down
3 changes: 3 additions & 0 deletions lib/plugins/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ export const LOGS = {
localEnvVarSet: (key: string) => {
return `Overwrote remote environment variable "${key}" with local.`;
},
deploymentError: (message: string) => {
return `DeploymentError: ${message}`;
},
} as const;

export const RESPONSES = {
Expand Down

0 comments on commit 7a8a38d

Please sign in to comment.