mirror of
https://github.com/withastro/astro.git
synced 2025-02-17 22:44:24 -05:00
Provide an error message when Actions throws in setup (#11886)
* Provide an error message when Actions throws in setup * Update .changeset/many-turtles-tie.md Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> --------- Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
This commit is contained in:
parent
f69605174b
commit
7ff7134b80
3 changed files with 19 additions and 1 deletions
5
.changeset/many-turtles-tie.md
Normal file
5
.changeset/many-turtles-tie.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fixes a missing error message when actions throws during `astro sync`
|
|
@ -27,6 +27,7 @@ export type LoggerLabel =
|
|||
| 'middleware'
|
||||
| 'preferences'
|
||||
| 'redirects'
|
||||
| 'sync'
|
||||
| 'toolbar'
|
||||
| 'assets'
|
||||
| 'env'
|
||||
|
|
|
@ -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 });
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue