summaryrefslogtreecommitdiff
path: root/website/scripts/ed.js
blob: 1cc6c9603003f3001acf9c51e2d49207f98fd77d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/// Copyright (c) 2012 Ecma International.  All rights reserved. 
/// This code is governed by the BSD license found in the LICENSE file.

//Error Detector
if (this.window!==undefined) {  //for console support
    this.window.onerror = function(errorMsg, url, lineNumber, colNumber, error) {
        var cookedError;

        if (error) {
            cookedError = error.toString();
        } else {
            if (/Error:/.test(errorMsg)) {
                cookedError = errorMsg;
            } else {
                cookedError = "UnknownError: " + errorMsg;
            }
        }

        $DONE(cookedError);
    };
}