Roman
Roman
@laneme Hey, that's right. It returns an object. You can read about here on Wiki https://github.com/animir/node-rate-limiter-flexible/wiki/RateLimiterUnion > So i cannot really easily do a check like this You can check...
@laneme When a RateLimiterUnion throws an error a developer would like to know what happened with one, two, or more limiters combined as a union. There should be a complex...
@laneme That's almost good. There is one complexity you didn't consider. One limiter can throw some fatal error, and another can throw RateLimiterRes. It can be a mix of errors....
@laneme > Does it still throw the object containing individual Responses? Yes, that's why the object with keys. One response can be successful RateLimiterRes, another can be an error of...
> Are you saying, because not all limiters failing, it would be more correct to throw an object instead of an error class? I am saying there could be two...
> I'm saying UnionRes can be just a simple wrapper and contain the very resObj as a property Ok, is it better than the object?
Ok, let's imagine, RateLimiterUnion rejects with err. How would you know you should write this code? ```js if (error instanceof UninonRes) { // do smth with error.limiters[keyprefix_A] // RateLimiterRes }...
RateLimiterUnion returns an object for resolved and rejected promise - it always returns an object. You don't need to check if it is object. If you add `UninonRes` it will...
@laneme > union.consume(...).catch(error => /** always object /*) Yes, exactly. No matter what happens resolved and rejected result is always an object. More on that, it has a defined type...
Thank you for the ideas. > No, this is not how people catch in the wild. See this two examples Those two examples above are usually enough. Any user would...