restangular icon indicating copy to clipboard operation
restangular copied to clipboard

Ability to have multiple SetErrorInterceptors

Open niemyjski opened this issue 10 years ago • 6 comments

I have multiple modules and each one might handle a different status code like 401 or 409. Would it be possible to support multiple error interceptors? https://github.com/mgonto/restangular/issues/488

Maybe it runs all of them and stops when one of them is handled.

niemyjski avatar Dec 29 '14 16:12 niemyjski

I've just got the same issue. That would be very good.

enapupe avatar Jan 22 '15 19:01 enapupe

This is already implemented and unit tests are passing, what's the issue you are having (code samples plz) ?

See those lines https://github.com/mgonto/restangular/blob/master/test/restangularSpec.js#L183-L211

grabbou avatar Feb 21 '15 12:02 grabbou

I had multiple interceptors setup in different modules and the ordering of them really messed up things. It's been a while (I reverted the code a while ago...), but basically I always wanted them all to run, not stop after the first one returned a result.

niemyjski avatar Feb 23 '15 23:02 niemyjski

@niemyjski Any update? Is this still an issue?

daviesgeek avatar Jun 17 '16 04:06 daviesgeek

Yes I do think so. I haven't tried for a long while as there hasn't been any updates to this lib

niemyjski avatar Jun 18 '16 13:06 niemyjski

Okay, would you mind providing a live example on Plunkr? This seems like something that should be fixed if it is an issue

daviesgeek avatar Jun 18 '16 17:06 daviesgeek