1

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.

zozo
  • 8,230
  • 19
  • 79
  • 134
  • errors like that usually mean that you messed sth up with your code that uses these libraries (i.e. you forgot to add coma, close the parenthesis, ...) - check your code, line through line – maialithar Mar 02 '12 at 14:36
  • nice option but there are lots and when I say lots I mean lots of scripts there... I can't just paste everything :). @matt – zozo Mar 02 '12 at 14:37
  • I agree on using JSLint, but the reason why is because it'll clean up your code in a way that should make wrong code look wrong. It will also help catch nasty little syntax errors. – zzzzBov Mar 02 '12 at 14:38
  • @h4: Usually if I get a syntax error I get the line in firebug... (exception at warnings)... this time I got nothing. Also the script doesn't break. – zozo Mar 02 '12 at 14:39
  • why can't you use JSLint? don't get lazy just because it's a large script. sometimes you just have to dive in and get dirty. – Matt K Mar 02 '12 at 14:41
  • 87 files. That are loaded dynamically in corelation with what users selects... that would be the main reason. I'm not lazy... or at least not that lazy... but that would be criminal. :P – zozo Mar 02 '12 at 14:43
  • well... I have a feeling something's seriously wrong if you have to load 87 different js scripts. – Matt K Mar 02 '12 at 15:11
  • Not if it is a damn game. Can we please stay on topic? – zozo Mar 06 '12 at 09:06

3 Answers3

2

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?

Community
  • 1
  • 1
user123444555621
  • 148,182
  • 27
  • 114
  • 126
0

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

Tuko
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 16 '22 at 22:28
0

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

Grant Zhu
  • 2,988
  • 2
  • 23
  • 28