Skip to content

Commit f3a8833

Browse files
authored
Better error messaging for build failures (#64)
1 parent 9290c71 commit f3a8833

2 files changed

Lines changed: 7 additions & 16 deletions

File tree

cmd/app/deploy.go

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -343,24 +343,12 @@ func pollDeploymentStatus(applicationID, organizationID, versionID string) (stri
343343

344344
// formatDeploymentError formats the deployment error message with nice styling
345345
func formatDeploymentError(errorMsg string) string {
346-
// Style definitions
347-
errorBoxStyle := lipgloss.NewStyle().
348-
Border(lipgloss.RoundedBorder()).
349-
BorderForeground(lipgloss.Color("196")).
350-
Padding(1, 2).
351-
Width(80)
352-
353346
titleStyle := lipgloss.NewStyle().
354347
Foreground(lipgloss.Color("196")).
355348
Bold(true)
356349

357-
messageStyle := lipgloss.NewStyle().
358-
Foreground(lipgloss.Color("252"))
359-
360-
// Format the error message
350+
// Format with just a title and raw logs
361351
title := titleStyle.Render("Deployment Error Details:")
362-
message := messageStyle.Render(errorMsg)
363-
364-
content := fmt.Sprintf("%s\n\n%s", title, message)
365-
return errorBoxStyle.Render(content)
352+
353+
return fmt.Sprintf("%s\n\n%s", title, errorMsg)
366354
}

cmd/resource/manage.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ var manageCmd = &cobra.Command{
1515
Use: "manage",
1616
Short: "Manage application resources",
1717
Long: `Select and configure resources for your application.`,
18-
PreRunE: middleware.Compose(
18+
PreRunE: middleware.ChainParent(
1919
middleware.CheckLogin,
20+
middleware.CheckNodeInstalled,
21+
middleware.CheckNodeVersion("22.12"),
22+
middleware.CheckPnpmInstalled,
2023
),
2124
RunE: func(cobraCmd *cobra.Command, args []string) error {
2225
return runManage(cobraCmd)

0 commit comments

Comments
 (0)