From 6d98255237d975ef66462850d5eae10b0963178f Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 10 Aug 2022 16:25:27 +0100 Subject: [PATCH] feat: add statusCode as well --- packages/nuxt/src/core/runtime/nitro/error.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/nuxt/src/core/runtime/nitro/error.ts b/packages/nuxt/src/core/runtime/nitro/error.ts index acb0271bb13..8c27cac531a 100644 --- a/packages/nuxt/src/core/runtime/nitro/error.ts +++ b/packages/nuxt/src/core/runtime/nitro/error.ts @@ -31,7 +31,8 @@ export default async function errorhandler (error: H3Error, '[nuxt]', '[request error]', error.unhandled && '[unhandled]', - error.fatal && '[fatal]' + error.fatal && '[fatal]', + Number(errorObject.statusCode) !== 200 && `[${errorObject.statusCode}]` ].filter(Boolean).join(' ') console.error(tags, errorObject.message + '\n' + stack.map(l => ' ' + l.text).join(' \n')) }