Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

QA stop(script problem) but not print error problem [SOLVED]


Question

Posted (edited)

I have a weird behavior with my HC3. When I make an error in my code, the program stops but there is no error showing in the console.

After a few seconds, it automatically restarts the program.

 

It only shows me parentheses errors, "end" missing or = missing or handlejson error.
But nothing else.

It also often happens that the HC3 is no longer accessible for several minutes following an error without it being a loop problem.

And still without displaying an error in the console.

 

Is it normal ?

Thanks for your help.

 

Edited by jwetzel
solved

15 answers to this question

Recommended Posts

  • 1
Posted

You can also add the fibaroExtra.lua file to your QA. It will protect setTimeout/setInterval and net.HTTPClient and log errors if callbacks crashes. Also gives better error for json.encode/json.decode...

 

  • Like 1
  • 1
  • Inquirer
  • Posted
    13 minutes ago, jgab said:

    How and from where do you call it?

    You get that error if you call :updateView on the class object (QuickApp) directly instead of the instance object (self)

    Ex.

    Please login or register to see this code.

    causes that error.

    Please login or register to see this code.

    works

     

    fibaroExtra don't patch or redefine :updateView

     

     

     

    Button run this function (main)

    Please login or register to see this code.

     

    Swisscom:updateInfo() save datas in the variable and run this function (main)

    Please login or register to see this code.

     

    Thats not correct ?

    • 0
    Posted
    53 minutes ago, jwetzel said:

    I have a weird behavior with my HC3. When I make an error in my code, the program stops but there is no error showing in the console.

    After a few seconds, it automatically restarts the program.

     

    It only shows me parentheses errors, "end" missing or = missing or handlejson error.
    But nothing else.

    It also often happens that the HC3 is no longer accessible for several minutes following an error without it being a loop problem.

    And still without displaying an error in the console.

     

    Is it normal ?

    Thanks for your help.

     

    If your code dies (has a bug) in a setTimeout/setInterval you don't get any error. In that case you need to wrap the function in a pcall. You can also have this issue with net.HTTPClient() callbacks to success/error.

    If your QA crash it automatically restarts after ~60s.

    • Like 3
    • 0
  • Inquirer
  • Posted
    1 hour ago, jgab said:

    You can also add the fibaroExtra.lua file to your QA. It will protect setTimeout/setInterval and net.HTTPClient and log errors if callbacks crashes. Also gives better error for json.encode/json.decode...

     

    Oh nice ! YOU SAVE MY LIFE 

    Haha

     

    You are a boss, thanks !

    • Like 1
    • 0
    Posted

    Jan, add to main?

    Or does it come later in an update ER4?

    //Sjakie

    • 0
    Posted
    48 minutes ago, Sjakie said:

    Jan, add to main?

    Or does it come later in an update ER4?

    //Sjakie

    pushed ER4 v68 where I have back-patched it from fibaroExtra to Toolbox.

    • 0
    Posted

    awesome!!!!!!!!!!!

    Thanks,

    //Sjakie

    • 0
    Posted

    Jan,

    Please login or register to see this attachment.

    • 0
    Posted
    12 minutes ago, Sjakie said:

    Jan,

    Please login or register to see this attachment.

    Oh, really bad. I pushed a fix but it's too late for people that already upgraded.

    Go into the QA files and the file "Toolbox" and line 694 and change

    Please login or register to see this code.

    to

    Please login or register to see this code.

     

    • 0
    Posted

    Thanks!!!

    You added more errors in debug?

    Found another 10 pieces with this update.

    //Sjakie

    • 0
    Posted
    10 minutes ago, Sjakie said:

    Thanks!!!

    You added more errors in debug?

    Found another 10 pieces with this update.

    //Sjakie

    Yes ?

    • 0
  • Inquirer
  • Posted

    @jgab, I don't know if this is a problem with the fibaroExtra, but it tells me an error of a function that does not exist in my code.

     

    Please login or register to see this image.

    /monthly_2021_07/image.png.1ae5e4f97262fbb6ae64c7c4c848b792.png" />

     

    This error occurs when I use self:updateView("label1", "text", "my txt") 

     

    Thats weird :/

    • 0
    Posted (edited)
    45 minutes ago, jwetzel said:

    @jgab, I don't know if this is a problem with the fibaroExtra, but it tells me an error of a function that does not exist in my code.

     

    Please login or register to see this link.

     

    This error occurs when I use self:updateView("label1", "text", "my txt") 

     

    Thats weird :/

    How and from where do you call it?

    You get that error if you call :updateView on the class object (QuickApp) directly instead of the instance object (self)

    Ex.

    Please login or register to see this code.

    causes that error.

    Please login or register to see this code.

    works

     

    fibaroExtra don't patch or redefine :updateView

    Edited by jgab
    • 0
  • Inquirer
  • Posted
    38 minutes ago, jgab said:

    How and from where do you call it?

    You get that error if you call :updateView on the class object (QuickApp) directly instead of the instance object (self)

    Ex.

    Please login or register to see this code.

    causes that error.

    Please login or register to see this code.

    works

     

    fibaroExtra don't patch or redefine :updateView

     

     

    Button refresh call function (in main)

    Please login or register to see this code.

    After get data in others functions, the last function call this function (in main)

    Please login or register to see this code.

     

    Thats not correct ?

    • 0
    Posted (edited)

    Somewhere in the call-chain something goes wrong - do you want to share the code with me in a PM and I can take a look at it?

    Swisscom is a class or your homemade table object?

    Edited by jgab

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...