Catch error no found, or I don't understand how it works?

I have forced an error, to test the nodes.

When the address changes the node changes to a red color, but I can not make has-error catch upstream node is in the error state
@nkrkv help!

GiganticFarawayHogget-size_restricted%5B1%5D

if in request add the following lines

    Wire.beginTransmission(addr);
    auto error = Wire.endTransmission();

    if (error == 2) {
        raiseError(ctx); // Invalid I2C address
        return;
    }

Watch value shows ERR and watch state TRUE , but it will only do it once and it is not marked in red.

CluelessImpoliteAntarcticfurseal-size_restricted%5B1%5D

Hi!
Could you please share a xodball with this patch?
I tried to reproduce this behaviour on my own but no luck so far.

1 Like

Hi, here is the patch, add the necessary nodes to compact it without modifying others

error-test.xodball (13.7 KB)

ps: I am using Arduino UNO, if I do a hard-reset has-error works and activates the output, but only once. (starting debug with invalid address)

1 Like

Hello! Yesterday we had a big discussion which was initiated by your example :heart: So, the reason you observe somewhat counter-intuitive contains two parts:

  1. The debugger in IDE processes incoming data once per 100 ms. If some nodes raise errors for short moments (far less 100 ms) and the recover almost immediately, IDE can (and likely will) miss the moments and not visualize the error. So, the program behavior is correct, but the visualization is not.
  2. The decision to clean up the errors propagated through pulse links at the end of a transaction is somewhat arguable. It does not behave intuitively in some cases. And you gave such an example.

We’ll try to fix (1) and think about (2).

Nevertheless, these points do not explain what you show on the first GIF. The only idea is that you have the standard library from 0.30.0 and not 0.30.1. Do you have a fork of the stdlib?

2 Likes

Hi, yes, the problem is with the similarity cycle, in some cases it is sometimes perceived and a red flash in the node that generates the error is sometimes not.

This would be a possibility but if I make a new workspace, it is created with the new version, which is the case of the example.

When an error appears in “watch” and “has-error” detects it, the color change does not happen at the start of the simulation, it changes color after a reset, but the color change does not occur in the has-error node , although still marking error.

Yesterday I thought that errors produced by hardware behave differently than errors generated by unexpected data.

Anyway I keep trying to see if there is something I did wrong, or else my pc does not simulate at the necessary speed.
Thanks.

Something happens there, the color is programmed but not the error.

If I open node lm75 in simulation I see that it goes out from the first read-byte, if I put an output-byte … the has-error node detects it.

new test

  1. Start with wrong address, return deactivated, red flashing on each cycle, I press reset button and it shows ERR until it changes to the correct address, at that moment it turns to red for a moment, then when changing address it returns flashing red color.
    UnitedPersonalAmericancrayfish-small%5B1%5D

  2. Added flip-flop to camp any error, no result positive. (no button reset, no capture)
    DefinitiveFinishedAndeancondor-small%5B1%5D