Skip to content

Commit 8060e0c

Browse files
mads-hartmannroboquat
authored andcommitted
Improve error diagnostics
1 parent 7a8b916 commit 8060e0c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.werft/util/preview.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export async function configureAccess(werft: Werft) {
9090
try {
9191
await installPreviewCTL()
9292
} catch (e) {
93-
throw new Error("Failed to install Previewctl")
93+
werft.fail(SLICES.INSTALL_PREVIEWCTL, e)
9494
}
9595

9696
try {
@@ -123,10 +123,10 @@ export async function configureAccess(werft: Werft) {
123123
export async function installPreviewCTL() {
124124
try {
125125
await execStream(`leeway run dev/preview/previewctl:install`, {
126-
slice: "Install previewctl",
126+
slice: SLICES.INSTALL_PREVIEWCTL,
127127
})
128128
} catch (e) {
129-
throw new Error("Failed to install previewctl.");
129+
throw new Error(`Failed to install previewctl: ${e}`);
130130
}
131131
}
132132

.werft/vm/vm.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export async function destroyPreview(options: { name: string }) {
1616
{slice: "Deleting VM."})
1717
} catch (err) {
1818
werft.currentPhaseSpan.setAttribute("preview.deleted_vm", false);
19-
werft.fail("Deleting VM.", new Error(`Failed creating VM: ${err}`))
19+
werft.fail("Deleting VM.", new Error(`Failed deleting VM: ${err}`))
2020
return;
2121
}
2222

0 commit comments

Comments
 (0)