Skip to content

Commit dfc6f4f

Browse files
committed
[release] Log err.path on tar upload failure for diagnostics
1 parent 016fc58 commit dfc6f4f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

packages/appwrite-utils-cli/src/functions/deployments.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,14 @@ export const uploadFunctionDeployment = async (
175175
return functionResponse;
176176
} catch (error) {
177177
progressBar.stop();
178-
MessageFormatter.error("Upload failed", error instanceof Error ? error : undefined, { prefix: "Deployment" });
178+
// Tar/node-fs errors carry the offending file path on `err.path`. Surface it
179+
// so failures like "did not encounter expected EOF" name the file that
180+
// tripped the size-mismatch check instead of leaving the operator guessing.
181+
const errPath =
182+
error && typeof error === "object" && "path" in error && typeof (error as { path: unknown }).path === "string"
183+
? ` (file: ${(error as { path: string }).path})`
184+
: "";
185+
MessageFormatter.error(`Upload failed${errPath}`, error instanceof Error ? error : undefined, { prefix: "Deployment" });
179186
throw error;
180187
} finally {
181188
try {

0 commit comments

Comments
 (0)