Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6825169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:59:24+00:00 2026-05-26T21:59:24+00:00

I want to log JavaScript errors so I’m overriding window.onerror like this: window.onerror =

  • 0

I want to log JavaScript errors so I’m overriding window.onerror like this:

window.onerror = function(message, file, lineNumber) {
    var browser_ = encodeURI(navigator.appVersion);
    var error_ = encodeURI("msg:"+ message + "\n\tfile:"+file+"\n\tln:"+lineNumber);
    var user_ = encodeURI("");

    ...

    return false;
}

I’ve seen some people return true and some return false. Which is right and why? One post mentioned something about have you have to return true or Firefox will handle the error it’s own way. What??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:59:25+00:00Added an answer on May 26, 2026 at 9:59 pm

    From MDN on window.onerror:

    When the function returns true, this prevents the firing of the default event handler.

    See also chromium Issue 92062:

    In Chrome, returning true from window.onerror allows the error to propagate, and returning false suppresses it.

    This is the inverse of the behavior in Firefox and IE, where returning ‘true’ suppresses the error, but returning false propagates it.

    Note: the issue mentioned above was fixed, behavior is now as mentioned on MDN for all browsers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to log/write all javascript errors to one text file when ever an
i want log linenumber to my log file, using log4net.the config details of log4net
i have this html and javascript program code for log in window. my html
In javascript I have an if statement and I want to log the first
I want to log my log strings to a file. I implemented the following
I want to log some seemingly random errors I'm getting in a Delphi written
I want to create a simple class in Javascript with only one public function
I want to log to the console when I'm using un-minimized JavaScript files. Comments
I want to be able to send myself all the javascript errors on a
I'm getting a syntax error in this simple javascript code. I just want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.