Hi Johannes, Depending on your exact code, there are a few things you might be observing here:
- If you are using `request.send()` but totally ignoring the Promise it returns, then technically you are sending the request and immediately canceling it! When you drop a promise (that is, allowing its destructor to run without having consumed it), you cancel the task it represents. However, for security reasons, RPCs on the server side aren't actually canceled unless the server opts into cancellation, since otherwise an unexpected cancellation might leave the server in a weird state. - If you are actually storing the returned promise and maybe using .then() (with two parameters) or .catch_() to catch errors, and you never see the error, it is probably because of lack of eager evaluation. You can solve that either by using .eagerlyEvaluate() or by adding the promise to a TaskSet (which has its own error handler). I usually recommend the latter, since .eagerlyEvaluate() is sort of a hack, but it can be situational. -Kenton On Tue, Mar 21, 2017 at 1:53 AM, Johannes Zeppenfeld <[email protected]> wrote: > I have an RPC interface where most interface methods do not return a > value, but perform some action on the server that may fail. > > If I just use `request.send();`, the call is made as intended, but any > errors (i.e., exceptions) on the server side are silently ignored. > > Is using `request.send().ignoreResult().eagerlyEvaluate(errorHandler);` > the intended method for detecting such errors from the client side? > > Is `kj::TaskSet` the appropriate container for storing such error handlers > until they resolve? > > While each of those types is well documented on its own, I haven't found a > lot of information on using the various types together. Is there a source > of documentation I have missed? Especially regarding error handling? > > Thanks! > Johannes > > -- > You received this message because you are subscribed to the Google Groups > "Cap'n Proto" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > Visit this group at https://groups.google.com/group/capnproto. > -- You received this message because you are subscribed to the Google Groups "Cap'n Proto" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. Visit this group at https://groups.google.com/group/capnproto.
