Simplify Next.js log error messages.

Hi guys, i have the following error message in the server console.
Error: Error when fetching available stores
nextjs | at Object.safe (./src/api/endpoint.helper.ts:11:19)
nextjs | at async Module.StoresAvailable (./src/api/query/stores-available/stores-available.ts:14:18)
nextjs | at async Promise.all (index 2)
nextjs | at async Layout ([store]/[lang]/layout.tsx:36:41)
nextjs | digest: "775247599"
nextjs | 11 | if (!response.success) {
nextjs | 12 | if (typeof arg.error === 'string') {
nextjs | > 13 | throw new Error(arg.error, { cause: response.error });
nextjs | | ^
nextjs | 14 | }
nextjs | 15 | throw arg.error(response.error);
nextjs | 16 | }
Error: Error when fetching available stores
nextjs | at Object.safe (./src/api/endpoint.helper.ts:11:19)
nextjs | at async Module.StoresAvailable (./src/api/query/stores-available/stores-available.ts:14:18)
nextjs | at async Promise.all (index 2)
nextjs | at async Layout ([store]/[lang]/layout.tsx:36:41)
nextjs | digest: "775247599"
nextjs | 11 | if (!response.success) {
nextjs | 12 | if (typeof arg.error === 'string') {
nextjs | > 13 | throw new Error(arg.error, { cause: response.error });
nextjs | | ^
nextjs | 14 | }
nextjs | 15 | throw arg.error(response.error);
nextjs | 16 | }
The error it's fine, but i wanna reduce the error. For example, i only wanna to be show the Error message.
Error: Error when fetching available stores
Error: Error when fetching available stores
How can i achieve this? Also how to change the color? I guess using pino logger?
No description
0 Replies
No replies yetBe the first to reply to this messageJoin