fix: expose more detailed error messages
This commit is contained in:
parent
d37aa61501
commit
71791c9513
27 changed files with 330 additions and 153 deletions
6
src/lib/error.ts
Normal file
6
src/lib/error.ts
Normal 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)
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue