jonsamwell / angular-http-batcher

Enables HTTP batch request with AngularJS
MIT License
96 stars 28 forks source link

Handling server errors #9

Closed PaddyMann closed 9 years ago

PaddyMann commented 9 years ago

If a server returns a 500 response (and so doesn't provide a response in the expected batched format), it doesn't seem to be getting handled.

This prevents us from doing simple error handling using $resource().$promise.catch()

Am I missing something? (p.s. love this component :))

jonsamwell commented 9 years ago

Thanks for using the module! I've had a quick glimpse at the code and it looks OK. I'll have created a test to look at what happens when a 500 code is returned and it all appears to be working OK. I think as you are using a $resource it might be a little different. Is there any chance you can give me a basic implementation of the code you are using (for angular) or create a plunker so I can replicate? Do you get any JavaScript error when this happens?

jonsamwell commented 9 years ago

It might also help me to fix the issue if you give me a copy of the raw HTTP response the server sends back. What server are you using?

Thanks!

PaddyMann commented 9 years ago

Apologies - an interceptor on httpProvider was the cause of the issues. Prevented any $http calls from correctly returning an error... my bad!

jonsamwell commented 9 years ago

No worries - this is why software is so hard a million things affecting a million other things. Thanks for using the module - let me know if you run into other issue or have any feature request :-)