Skip to content

Commit f2bfe68

Browse files
authored
Merge pull request #5232 from Shopify/01-17-improve_ui_when_displaying_multiple_errors_returned_from_dev-update_create
Improve UI when displaying multiple errors returned from dev-update/create
2 parents 850358c + 2ff0b81 commit f2bfe68

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/app/src/cli/services/dev/processes/dev-session.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -323,13 +323,12 @@ async function processUserErrors(
323323
} else if (errors instanceof Error) {
324324
await printError(errors.message, stdout)
325325
} else {
326-
for (const error of errors) {
326+
const mappedErrors = errors.map((error) => {
327327
const on = error.on ? (error.on[0] as {user_identifier: unknown}) : undefined
328-
// If we have information about the extension that caused the error, use the handle as prefix in the output.
329328
const extension = options.app.allExtensions.find((ext) => ext.uid === on?.user_identifier)
330-
// eslint-disable-next-line no-await-in-loop
331-
await printError(error.message, stdout, extension?.handle ?? 'dev-session')
332-
}
329+
return {error: error.message, prefix: extension?.handle ?? 'dev-session'}
330+
})
331+
await printMultipleErrors(mappedErrors, stdout)
333332
}
334333
}
335334

0 commit comments

Comments
 (0)