fix: expose more detailed error messages

This commit is contained in:
codytseng 2026-01-17 11:50:24 +08:00
parent d37aa61501
commit 71791c9513
27 changed files with 330 additions and 153 deletions

6
src/lib/error.ts Normal file
View file

@ -0,0 +1,6 @@
export function formatError(error: unknown): string[] {
const errors = error instanceof AggregateError ? error.errors : [error]
return errors.map((err) => {
return err instanceof Error ? err.message : String(err)
})
}