diff --git a/.github/workflows/smoke-test-node-api.yml b/.github/workflows/smoke-test-node-api.yml index a1831644b..29d2accd6 100755 --- a/.github/workflows/smoke-test-node-api.yml +++ b/.github/workflows/smoke-test-node-api.yml @@ -13,7 +13,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-node@v3 with: - node-version: latest + node-version: 'lts/*' - run: corepack enable - run: yarn - run: yarn build diff --git a/node-src/tasks/upload.ts b/node-src/tasks/upload.ts index 898eb212b..d1b4d7e36 100644 --- a/node-src/tasks/upload.ts +++ b/node-src/tasks/upload.ts @@ -14,6 +14,7 @@ import { rewriteErrorMessage, throttle } from '../lib/utils'; import { waitForSentinel } from '../lib/waitForSentinel'; import { Context, FileDesc, Task } from '../types'; import missingStatsFile from '../ui/messages/errors/missingStatsFile'; +import sentinelFileErrors from '../ui/messages/errors/sentinelFileErrors'; import bailFile from '../ui/messages/warnings/bailFile'; import deviatingOutputDirectory from '../ui/messages/warnings/deviatingOutputDirectory'; import { @@ -274,7 +275,12 @@ export const waitForSentinels = async (ctx: Context, task: Task) => { }) ); - await Promise.all(Object.values(sentinels).map((sentinel) => waitForSentinel(ctx, sentinel))); + try { + await Promise.all(Object.values(sentinels).map((sentinel) => waitForSentinel(ctx, sentinel))); + } catch (err) { + ctx.log.error(sentinelFileErrors()); + throw err; + } }; export default createTask({ diff --git a/node-src/ui/messages/errors/sentinelFileErrors.stories.ts b/node-src/ui/messages/errors/sentinelFileErrors.stories.ts new file mode 100644 index 000000000..3e56b2499 --- /dev/null +++ b/node-src/ui/messages/errors/sentinelFileErrors.stories.ts @@ -0,0 +1,7 @@ +import sentinelFileErrors from './sentinelFileErrors'; + +export default { + title: 'CLI/Messages/Errors', +}; + +export const SentinelFileErrors = () => sentinelFileErrors(); diff --git a/node-src/ui/messages/errors/sentinelFileErrors.ts b/node-src/ui/messages/errors/sentinelFileErrors.ts new file mode 100644 index 000000000..61d69039d --- /dev/null +++ b/node-src/ui/messages/errors/sentinelFileErrors.ts @@ -0,0 +1,10 @@ +import chalk from 'chalk'; +import { dedent } from 'ts-dedent'; + +import { error } from '../../components/icons'; +import link from '../../components/link'; + +export default () => + dedent(chalk` + ${error} Failed to finalize upload. Please check ${link('https://status.chromatic.com/')} or contact support. + `);