What happened?
Hello,
Thanks for the library. I'm a bit unsure of the right way to handle errors with the refreshTokenGrant method. I'm not sure if this is a bug so hope you will forgive the issue if not. Ultimately I want to do this...
try {
await refreshTokenGrant(...)
} catch (error) {
if (error.intermittent) {
// retry later
} else {
// delete refresh token and log user out
}
}
The docs don't make it clear on what refreshTokenGrant throws however.
I had a poke about in the source (read errorHandler) and I can see that it is rethrowing errors from the oauth4webapi library in many cases (so I could try install that library and catch those errors) but there is another ClientError type too.
So my question ultimately is what is the right way to do this? And assuming you agree with the above the request is for the docs to make that clear. Please tell me if I'm doing something stupid.
Many thanks
Version
v6.8.4
Runtime
Select an option
Runtime Details
Node 24
Code to reproduce
Required
What happened?
Hello,
Thanks for the library. I'm a bit unsure of the right way to handle errors with the
refreshTokenGrantmethod. I'm not sure if this is a bug so hope you will forgive the issue if not. Ultimately I want to do this...The docs don't make it clear on what
refreshTokenGrantthrows however.I had a poke about in the source (read
errorHandler) and I can see that it is rethrowing errors from theoauth4webapilibrary in many cases (so I could try install that library and catch those errors) but there is another ClientError type too.So my question ultimately is what is the right way to do this? And assuming you agree with the above the request is for the docs to make that clear. Please tell me if I'm doing something stupid.
Many thanks
Version
v6.8.4
Runtime
Select an option
Runtime Details
Node 24
Code to reproduce
Required