javascript exception in messages.html

Issue #212 resolved
Zaher Salman created an issue

The javascript code in messages.html produces a javascript exception due to undefined rpc result:

javascript exception: TypeError: rpc.result.messages is undefined

This seems to be coming from line 264

  mjsonrpc_call("cm_msg_retrieve", { "facility": facility, "time" : first_tstamp, "min_messages" : 0 }).then(function(rpc) {

if we change “min_messages” to 1 the issue is resolved.

Comments (6)

  1. Zaher Salman reporter

    By the way, if your midas is giving some messages between reloads then you will not get any errors. You midas should have no messages issued ("min_messages" : 0) and then you will get the exception as you can see from the code. Our midas happens to be quiet most of the time, so there are no messages being filled all the time.

  2. Stefan Ritt

    min_message =0 is a special parameter of cm_msg_retrieve which returns messages BEFORE the parameter “time”. So it is correct.

    I also don’t see this problem, but I added some code to check rpc.result.messages to be defined before going on. Check if that works for you, then please close that issue.

  3. Log in to comment