0

If I call a web API method (which throws an exception) using breeze's executeQuery method (Breeze version is 1.6.3), the errorCallback function is never called.

var eq = new breeze.EntityQuery('TestError'); 
manager.executeQuery( 
    eq, 
    function(data) { console.log('success') }, 
    function(err) { console.log('error') }
);

this is the api method

[HttpGet] 
public void TestError() { 
    throw new Exception("test exception"); 
}

nor does it work with what is described here (see executeQuery method)

My app uses Aurelia and the aurelia-breeze plugin, and I suppose this problem happens because aurelia-breeze replaces Q with ES6 Promises. Is it possible to have the errorCallback called anyway? Or am I just doing something wrong?

Here is my original post on the aurelia-breeze github page

1 Answer 1

0

I have solved it (at least I think so), by adding an extra .catch() in an inner Promise in aurelia-breeze's source files. Details here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.