Skip to content

Don't log 404s to console #12900

Answered by EskelCz
Dig-Doug asked this question in Q&A

You must be logged in to vote

The only way I found is this:
hooks.server.js

export function handleError({ error }) {
  if (!error.message.includes('Not found')) { // Ignore 404 Not Found
    console.error(error.stack)
    return { message: 'Internal Error' }
  }
}

Replies: 1 comment

You must be logged in to vote
0 replies
Answer selected by Dig-Doug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants