It appears on ln 96 in nahmii-provider.js, Promise.reject is thrown and not caught anywhere within the SDK.
The function throwing Promise.reject is initiated from a call to the NahmiiProvider.getApiAccessToken method.
When this method is called manually by the user, the error can be caught by wrapping the call in a try catch statement, which is fine.
The issue I'm experiencing is that on initialization, NahmiiProvider instances are set to automatically call this method every minute. If there's a network error, the error will be thrown and I can't find a way to handle it.
Not sure if there's an obvious way to catch this that I'm missing, but until I do find a solution it'll be an issue in the hubii core project which is currently configured to loudly complain if there're any unhandled errors.
A simple fix is just to return the error instead of throwing via Promise.reject, but not sure if that's the cleanest solution, or if there's a way to catch this outside of the SDK.
It appears on ln 96 in
nahmii-provider.js
,Promise.reject
is thrown and not caught anywhere within the SDK.The function throwing
Promise.reject
is initiated from a call to theNahmiiProvider.getApiAccessToken
method.When this method is called manually by the user, the error can be caught by wrapping the call in a try catch statement, which is fine.
The issue I'm experiencing is that on initialization,
NahmiiProvider
instances are set to automatically call this method every minute. If there's a network error, the error will be thrown and I can't find a way to handle it.Not sure if there's an obvious way to catch this that I'm missing, but until I do find a solution it'll be an issue in the hubii core project which is currently configured to loudly complain if there're any unhandled errors.
A simple fix is just to return the error instead of throwing via
Promise.reject
, but not sure if that's the cleanest solution, or if there's a way to catch this outside of the SDK.Any input would be appreciated @morfj
Thanks