fix: make sure all logged errors are preceeded with a message
Just logging an error makes it difficult to relate the error log to code in the codebase. Error logging a message right before the error itself makes it easier to search the codebase for that error log.
This commit is contained in:
@@ -56,7 +56,7 @@ export const middleware: NextMiddleware = async (request, event) => {
|
||||
} catch (e) {
|
||||
if (e instanceof NextResponse && e.status) {
|
||||
const cause = await e.json()
|
||||
console.error(`Error in middleware`)
|
||||
console.error(`NextResponse Error in middleware`)
|
||||
console.error(cause)
|
||||
|
||||
return NextResponse.rewrite(
|
||||
|
||||
Reference in New Issue
Block a user