feat: pretty-print-error to print errors in console (#1596)

Co-authored-by: Manuel <30572287+manuel-rw@users.noreply.github.com>
This commit is contained in:
Meier Lukas
2024-12-05 17:24:23 +01:00
committed by GitHub
parent 86cd1017b9
commit 71f4f8c4c8
5 changed files with 39 additions and 1 deletions

View File

@@ -0,0 +1,16 @@
diff --git a/src/index.ts b/src/index.ts
index c8f62a743b89040c1d10a8ae3795bec8afcbc134..7cd7c1e98c1c9516b40f678627f51fd1adfa18c7 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -109,9 +109,9 @@ export function formatError(
(name) => name !== "stack" && name !== "message"
);
if (propNames.length > 0) {
- const props = {};
+ const props: Record<string, unknown> = {};
propNames.forEach((name) => {
- props[name] = err[name];
+ props[name] = (err as Record<string, object>)[name];
});
let propertiesString;