Mirko Lugano
Mirko Lugano

Reputation: 985

Breeze's errorCallback function is never called

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

Upvotes: 0

Views: 32

Answers (1)

Mirko Lugano
Mirko Lugano

Reputation: 985

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

Upvotes: 0

Related Questions