summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.changeset/many-turtles-tie.md5
-rw-r--r--packages/astro/src/core/logger/core.ts1
-rw-r--r--packages/astro/src/core/sync/index.ts14
3 files changed, 19 insertions, 1 deletions
diff --git a/.changeset/many-turtles-tie.md b/.changeset/many-turtles-tie.md
new file mode 100644
index 000000000..e98a6c5c7
--- /dev/null
+++ b/.changeset/many-turtles-tie.md
@@ -0,0 +1,5 @@
+---
+'astro': patch
+---
+
+Fixes a missing error message when actions throws during `astro sync`
diff --git a/packages/astro/src/core/logger/core.ts b/packages/astro/src/core/logger/core.ts
index 530399ac4..c06866df5 100644
--- a/packages/astro/src/core/logger/core.ts
+++ b/packages/astro/src/core/logger/core.ts
@@ -27,6 +27,7 @@ export type LoggerLabel =
| 'middleware'
| 'preferences'
| 'redirects'
+ | 'sync'
| 'toolbar'
| 'assets'
| 'env'
diff --git a/packages/astro/src/core/sync/index.ts b/packages/astro/src/core/sync/index.ts
index 2a7aa83ce..8b659a4f5 100644
--- a/packages/astro/src/core/sync/index.ts
+++ b/packages/astro/src/core/sync/index.ts
@@ -61,7 +61,19 @@ export default async function sync(
settings,
logger,
});
- await runHookConfigDone({ settings, logger });
+
+ // Run `astro:config:done`
+ // Actions will throw if there is misconfiguration, so catch here.
+ try {
+ await runHookConfigDone({ settings, logger });
+ } catch(err) {
+ if(err instanceof Error) {
+ const errorMessage = err.toString();
+ logger.error('sync', errorMessage);
+ }
+ throw err;
+ }
+
return await syncInternal({ settings, logger, fs, force: inlineConfig.force });
}