rcloud icon indicating copy to clipboard operation
rcloud copied to clipboard

Rserve.wrap_ocap should detect errors

Open gordonwoodhull opened this issue 11 years ago • 7 comments

It passes the error forward as a valid result, where I think it should use the error continuation instead:

        s.OCcall(ocap, values, function(err, v) {
            if (!_.isUndefined(v))
                v = Rserve.wrap_all_ocaps(s, v); 
            k(err, v);
        });

If v contains an error, the continuation is still called with err==null and v containing the error.

The particular error I've got at the moment would be easy to detect:

> _.extend({}, v)
    Object {0: "Error in fun(...) : could not find function "RC.get.range"↵", r_type: "string_array", r_attributes: Object}
        0: "Error in fun(...) : could not find function "RC.get.range"↵"
      r_attributes: Object
        class: "try-error"
        condition: Object
        __proto__: Object
        r_type: "string_array"
        __proto__: Object

.. and I expect that most exceptions from an R ocap will have a similar format

gordonwoodhull avatar May 25 '14 19:05 gordonwoodhull

Yeah, I think this is really a bug, actually.

cscheid avatar May 25 '14 20:05 cscheid

I can fix that if you'd rather do something else.

cscheid avatar May 25 '14 21:05 cscheid

Thanks.. I'm working on dc, actually... I just report bugs as I find them.

Ran into this while trying to figure out whether leaflet notebooks still work with the AMD stuff. I think they do but the particular notebook I was testing needed a library and some data which I don't have locally.

gordonwoodhull avatar May 25 '14 21:05 gordonwoodhull

I would claim this is a bug in rserve-js rather than rcloud, but in the rserve-js test suite there is a test specifically about raising exceptions and making sure they're handled by the error path (it's a bluebird catch). So I'm confused now.

EDIT: Yeah, there's definitely something bizarre happening. I'm going to have to confer with Simon on Friday to see what's up.

cscheid avatar May 27 '14 13:05 cscheid

Related:

  • #674 failed javascript parse unreported.
  • #753 silent failure calling JS with bad parameters

gordonwoodhull avatar Jul 05 '14 07:07 gordonwoodhull

@s-u, I believe this is the issue we were talking about. Almost three years old, wow.

Pretty intense systems hacking. I would love to work on this if I can find a few days of concentration.

Like #1376, I think this may have unexpected consequences since there may be errors being thrown and ignored, accidentally or harmlessly, which actually should be ignored. So I'm going to be cautious and put this into 1.8 (which we can deploy to research early if we like).

gordonwoodhull avatar Feb 07 '17 15:02 gordonwoodhull

2.2 for reals

gordonwoodhull avatar Dec 05 '18 13:12 gordonwoodhull