Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve UI when displaying multiple errors returned from dev-update/create #5232

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions packages/app/src/cli/services/dev/processes/dev-session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,12 @@ async function processUserErrors(
} else if (errors instanceof Error) {
await printError(errors.message, stdout)
} else {
for (const error of errors) {
const mappedErrors = errors.map((error) => {
const on = error.on ? (error.on[0] as {user_identifier: unknown}) : undefined
// If we have information about the extension that caused the error, use the handle as prefix in the output.
const extension = options.app.allExtensions.find((ext) => ext.uid === on?.user_identifier)
// eslint-disable-next-line no-await-in-loop
await printError(error.message, stdout, extension?.handle ?? 'dev-session')
}
return {error: error.message, prefix: extension?.handle ?? 'dev-session'}
})
await printMultipleErrors(mappedErrors, stdout)
}
}

Expand Down
Loading