From 05e96baa3f197e73fa831a411f565055285b068d Mon Sep 17 00:00:00 2001 From: Tobbe Lundberg Date: Mon, 29 Apr 2024 11:33:55 +0200 Subject: [PATCH] feat(baremetal): Add more details to error messages (#10527) --- .changesets/10527.md | 10 ++++++++++ .../cli/src/commands/deploy/baremetal/SshExecutor.js | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .changesets/10527.md diff --git a/.changesets/10527.md b/.changesets/10527.md new file mode 100644 index 000000000000..697d58b5ab02 --- /dev/null +++ b/.changesets/10527.md @@ -0,0 +1,10 @@ +- feat(baremetal): Add more details to error messages (#10527) by @Tobbe + +Now when an ssh command execution fails the error message will additionally +include the directory it was executed in and the full stderr message + +## Before +![image](https://github.com/redwoodjs/redwood/assets/30793/bda480ee-7c26-40c8-9128-42a830574a53) + +## After +![image](https://github.com/redwoodjs/redwood/assets/30793/85080fa8-be2f-4638-9af1-0ba4c79057e3) diff --git a/packages/cli/src/commands/deploy/baremetal/SshExecutor.js b/packages/cli/src/commands/deploy/baremetal/SshExecutor.js index c9f5ebe8daf4..4978a930dbf3 100644 --- a/packages/cli/src/commands/deploy/baremetal/SshExecutor.js +++ b/packages/cli/src/commands/deploy/baremetal/SshExecutor.js @@ -28,7 +28,8 @@ export class SshExecutor { if (result.code !== 0) { const error = new Error( - `Error while running command \`${command} ${args.join(' ')}\``, + `Error while running command \`${command} ${args.join(' ')}\` in ${path}\n` + + result.stderr, ) error.exitCode = result.code throw error