Skip to content

Commit bcd49f8

Browse files
committed
Improve logging
1 parent f858cab commit bcd49f8

File tree

2 files changed

+14
-5
lines changed
  • sources
    • client/src/logging
    • server/src/Modules/E2e/resources/js/post-types-example-block

2 files changed

+14
-5
lines changed

sources/client/src/logging/index.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ addAction(
77
'wp-entities-search/wp-on-change-entities.error',
88
(error) => {
99
console.error(
10-
`Composite Entities by Kind - on Change Entities: ${error}`
10+
`Composite Entities by Kind - on Change Entities: ${
11+
new Error(error).message
12+
}`
1113
);
1214
}
1315
);
@@ -16,15 +18,19 @@ addAction(
1618
'wp-entities-search.on-change-kind.error',
1719
'wp-entities-search/wp-on-change-entities.error',
1820
(error) => {
19-
console.error(`Composite Entities by Kind - on Change Kind: ${error}`);
21+
console.error(
22+
`Composite Entities by Kind - on Change Kind: ${
23+
error.message ?? error
24+
}`
25+
);
2026
}
2127
);
2228

2329
addAction(
2430
'wp-entities-search.on-storage-initialization.error',
2531
'wp-entities-search/on-storage-initialization.error',
2632
(error) => {
27-
console.error(`Composite Entities by Kind: ${error}`);
33+
console.error(`Composite Entities by Kind: ${error.message ?? error}`);
2834
}
2935
);
3036

@@ -33,7 +39,10 @@ addAction(
3339
'wp-entities-search/on-search.error',
3440
(error) => {
3541
console.error(
36-
`Composite Entities by Kind - on Search Entities: ${error}`
42+
`Composite Entities by Kind - on Search Entities: ${
43+
error.message ?? error
44+
}`
3745
);
46+
console.table(error);
3847
}
3948
);

sources/server/src/Modules/E2e/resources/js/post-types-example-block/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
document.addEventListener('DOMContentLoaded', () => {
2-
const UNSUPPORTED_CPTS = ['attachment'];
2+
const UNSUPPORTED_CPTS = [''];
33

44
const { wp, wpEntitiesSearch } = window;
55

0 commit comments

Comments
 (0)