ReferenceError: OK is not defined

362 views
Skip to first unread message

Steven Neiland

unread,
Dec 13, 2013, 12:52:53 PM12/13/13
to bugl...@googlegroups.com
I am just getting started using buglog from the client side using a simple 1 page test app. While testing I noticed that when I call BugLog.notifyService firebug shows a javascript error "ReferenceError: OK is not defined"

The error does get correctly logged to buglog and the reset service returns "OK" so I don't know what I am seeing this. Im not sure if it is a firebug or buglog issue.

Aside: I don't know if this makes any difference but I am sending to the listener over ssl.

Browser: Firefox 25.0.1
OS: Windows 7
Plugin: Firebug 1.12.5

Here is the code to replicate.
<html>
<head>
<script type="text/javascript" src="bugLogClient.js"></script>
</head>
<body>
    <script>
    BugLog.listener = "https://buglog.ourdomain.com/bugLog/listeners/bugLogListenerREST.cfm";
    BugLog.appName = "Your_App_Name";

    try {
        alert(test);           
    } catch(e) {
        BugLog.notifyService({
            message: e.message,
            error: e,
            severity: "ERROR"
        });
    }
 
</script>
</body>
</html>

Don Quist

unread,
Dec 13, 2013, 1:05:26 PM12/13/13
to bugl...@googlegroups.com
I haven't used the JS client before, but it kinda sounds like the bugLogClient.js is trying to use the return from logging as a variable.  does it say what line# the error happens at?


--
 
---
You received this message because you are subscribed to the Google Groups "BugLogHQ" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bugloghq+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
- Don Quist
www.SigmaProjects.org

Don Quist

unread,
Dec 13, 2013, 1:55:44 PM12/13/13
to bugl...@googlegroups.com
About this error, the simple fix to is to modify listeners/bugLogListenerREST.cfm and change <cfoutput>OK</cfoutput> to <cfoutput>"OK"</cfoutput> so the return is a string.
Dunno if this is the proper solution, or if we can get the dynamic script tag created by bugLogClient.js createNotifier() to not treat the return as a variable.  I tried modifying the created script tag to include notifier.onload = function(e) {return;} but it didn't help.

Hopefully Oscar can chime in

Oscar Arevalo

unread,
Dec 13, 2013, 2:03:07 PM12/13/13
to bugl...@googlegroups.com
Hey,
Haven't noticed the error before. I like a solution in the lines of what Don suggests (i.e. making the CFM response more 'valid') so that its response does not create a problem with the way the client uses it.

I have a few contributions to merge on the pipeline, so I can add this change and make a minor point release to address this in the next few days.

Oscar

Oscar Arevalo

Steven Neiland

unread,
Dec 13, 2013, 2:27:38 PM12/13/13
to bugl...@googlegroups.com
Ok I put in that tweak and the error is gone now. Thanks for the quick response everyone!
Reply all
Reply to author
Forward
0 new messages