jwt-autorefresh icon indicating copy to clipboard operation
jwt-autorefresh copied to clipboard

Cannot properly handle errors in refresh()

Open apomortsev opened this issue 7 years ago • 4 comments

Hello, First of all thank you for creating this package, I'm finding it very useful. I'm having an issue with gracefully handling the error when refresh() fails to produce a valid token. Returning a resolved promise from refresh() with no token causes _schedule() to throw internally. A rejected promise from referesh() is re-thrown in execute(). In both cases the resulting rejected promise cannot be handled in user code resulting in an unhandled rejection error.

apomortsev avatar May 26 '17 18:05 apomortsev

@apomortsev - thanks for reporting, I'll get a unit test in to try and repro your findings and get it patched up (today / this weekend depending on time).

cchamberlain avatar May 27 '17 00:05 cchamberlain

Lost track of this one. Planning to get back to it after I get v2 out for https://github.com/noderaider/redux-idle-monitor

cchamberlain avatar Nov 22 '17 19:11 cchamberlain

hi @apomortsev did you find any alternatives?

puneetv05 avatar Mar 23 '21 17:03 puneetv05

Hi @puneetverma05, no, not at the time. But it's been some time and chances are there might be some similar or more suitable packages around, but I never checked.

apomortsev avatar Mar 24 '21 02:03 apomortsev