 # Waits for the DOM to be ready
 # Send client side errors to server
-window.onerror = (msg, url, line) ->
-    console.log msg, url, line
+window.onerror = (msg, url, line, col, error) ->
+    console.error msg, url, line, col, error
     data =
         data:
             type: 'error'

        ContactActionCreator.searchContact()

    catch e
        # Send client side errors to server
        data =
            data:
                type: 'error'
                exception: e
        xhr = new XMLHttpRequest()
        xhr.open 'POST', 'activity', true
        xhr.setRequestHeader "Content-Type", "application/json;charset=UTF-8"
        xhr.send JSON.stringify(data)


                msg: msg
            url: url
            line: line
            col: col
            error: error.toString()
            stack: error.stack
            href: window.location.href
    xhr = new XMLHttpRequest()
    xhr.open 'POST', 'activity', true
