autobahn-js icon indicating copy to clipboard operation
autobahn-js copied to clipboard

autobahn.Error should contain the "details" parameter

Open trombipeti opened this issue 2 years ago • 1 comments

autobahn.Error now contains error, args and kwargs. According to the spec, there's always a "details" parameter available (it's a dict). This should be stored in the Error class.

In the code, I see this in the handlers for the ERROR messages:

var details = msg[3];
var error = new Error(msg[4], msg[5], msg[6]);

And the details seems to be not used. So I think it would be relatively easy to implement. I can make a PR if you like.

Thanks!

Edit: this details parameter seems to be ignored for other types of messages, too. I start to think, maybe it's intentional?

trombipeti avatar Oct 06 '21 08:10 trombipeti

in general, the details attribute is present for symmetry reasons and to support future extensibility, and I think in the case of ERROR messages, eg Crossbar.io should add stuff like Callee information (the WAMP peer that returned an error).

I also think that autobahn-js does already expose details for call results .. not sure. In any case, if we do so, then we might as well want to expose details not only in call results but also call errors. @om26er what do you think?

oberstet avatar Oct 19 '21 22:10 oberstet