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

  • SEARCH
  • Home
  • 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 8661445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:29:59+00:00 2026-06-12T16:29:59+00:00

Now I use this code to save error log from user to database window.onerror

  • 0

Now I use this code to save error log from user to database

window.onerror = function (msg, url, line) {
    $.ajax({
        type: "POST",
        url: "call/savelog.php",
        data: {
            type : "bug\n" + version,
            message : 'Error message: '+msg+'\nURL: '+url+'\nLine Number: '+line
        }
    });
    return true;
};

when error occur on jquery or kineticjs function

if it was in javascript console I will got something like this

Uncaught TypeError: Cannot read property '_id' of undefined kinetic-v4.0.2.js:1386
Kinetic.Node.remove kinetic-v4.0.2.js:1386
Kinetic.Layer.remove kinetic-v4.0.2.js:3667
drawCountdown side_play.js:105

so I’ll know error cause by my drawCountdown function in my javascript file side_play.js
but it appear like this in my error log

Error message: Uncaught TypeError: Cannot read property '_id' of undefined
URL: https://myurl.com/js/kinetic-v4.0.2.js
Line Number: 1386 

so I don’t know which function that cause the error.
how to track down to the deepest function that cause error and save error log to database

  • 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-06-12T16:30:00+00:00Added an answer on June 12, 2026 at 4:30 pm

    You can wrap your functions in try/catch statements and if an error occurs you can catch errors and then write them in file via server for example.

    try {
      yourFunctionCallHere();
    } catch (err) {
       var message = 'yourFunctionCallHere failed: ' + err.message;
       //now you can do smth with this error message, for example send an ajax request to the server...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

now i use this code: $welcome_text = mysql_query(SELECT * FROM `text` WHERE `name` =
Right now I can use this URL to request a Google Static Maps image
I'm getting a save() got an unexpected keyword argument 'force_insert' error. From this http://groups.google.com/group/django-users/browse_thread/thread/2471efd68d56ad59
This is the error I get while trying to access a sqlite database from
i am trying to use this code: <%= File.ReadAllText(Server.MapPath(Members/newsletters/welcome.html))%> which works great but now
i use this method before 1 time. but Now i can not get video
In pylint I use this command --reports=n to disable the reports, but now I
This scenario comes up often, now that I use LinkToSql and the classes it
I've been fighting this problem for many hours now and could really use some
I use the wonderful jQuery-plugin Galleriffic to display image galeries. Now this works great,

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.