DiegoZoracKy/oas-client

Axios rejections don't filter through into promise rejection for 503.

Opened this issue · 3 comments

This is something I've noticed using oas-client when the service I'm pinging all of a sudden goes down, axios returns the 503, but oas-client doesn't filter that back through to the created client.

 const client = oasClient.create(schema); 
 client.doAction({ ... }).then((s) => {})
 .catch((e) => {}); // Never gets called on 503

Checking, it looks like the path lib/make-api-call.js:makeApiCall is the cause.

Hi @rageycomma, thanks for bringing this issue. I'll take a look at it, but if you would like to send a PR, feel free to do it.

Of course, if I get time I'll do a PR :) I just wanted to make you aware of it!

Great. Indeed, thanks for letting me know.