zozo
zozo

Reputation: 8582

javascript how to find an error in a script

I know this is a little to less to get an answer on what the problem is so what I ask is how to debug it.

I get the following error (the image below). No line, script or anything specified. Also except the ones in jQuery and raphaeljs libraries I don't have any custom error handler defined.

enter image description here

Got any ideas on how to debug this?

(The main script for example has around 3k lines and since I don't know where the error occurs I don't know witch part of it to post. I need only a way to find that.)

Thank you for your time.

Upvotes: 1

Views: 3206

Answers (3)

Tuko
Tuko

Reputation: 1

local function ensureAnimDict(animDict) if not HasAnimDictLoaded(animDict) then RequestAnimDict(animDict) while not HasAnimDictLoaded(animDict) do Wait(0) end return animDict end

Upvotes: 0

Grant Zhu
Grant Zhu

Reputation: 3018

Try chrome. Webkit can provide stack traces: Web Inspector: Understanding Stack Traces

Sample:

<script>
    function i2(){
        throw "CustomError";
    }
    function invoke(){
        i2();
    }

</script>
<button onclick="invoke()">yo</button>

enter image description here

Upvotes: 0

user123444555621
user123444555621

Reputation: 152986

This happens when the script throws a string, rather than a proper exception, like:

throw 'Error in protected function: )55';

See this other SO question for possible solutions:

How can I get a Javascript stack trace when I throw an exception?

Upvotes: 2

Related Questions