Skip to content

Commit e98025c

Browse files
authored
[Blueprints] Preserve more error information on failed fetch (#2946)
## Motivation for the change, related issues Before this PR a failed fetch would only print surface level error: ``` [WordPress Server Child] Failed to start server: Error: Error when executing the blueprint step #3 ({"step":"installPlugin","pluginData":{"resource":"wordpress.org/plugins","slug":"woocommerce"}}) : Could not download "https://downloads.wordpress.org/plugin/woocommerce.latest-stable.zip". ``` After this PR a failed fetch includes the original error cause and provides the full error information including the original stack trace. ## Implementation details Just adds `{ cause: error }`
1 parent 10277ed commit e98025c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/playground/blueprints/src/lib/v1/resources.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,8 @@ export abstract class FetchResource extends Resource<File> {
388388
throw new Error(
389389
`Could not download "${url}".\n\n` +
390390
`Confirm that the URL is correct, the server is reachable, and the file is` +
391-
`actually served at that URL. Original error: \n ${e}`
391+
`actually served at that URL. Original error: \n ${e}`,
392+
{ cause: e }
392393
);
393394
}
394395
}

0 commit comments

Comments
 (0)