storage
storage copied to clipboard
Document that `chrome.runtime.lastError` causes a rejection
Documentation Is:
- [x] Missing
- [ ] Needed
- [ ] Confusing
- [ ] Not Sure?
Please Explain in Detail...
If there is an error when executing the callbacks passed to the chrome API, chrome.runtime.lastError
will be set. On the docs for this package or the source code I have not been able to find a reference to that situation. Also, as this uses promises, the check on the promise's then
will not work since the lastError
is only set inside the callback.
Your Proposal for Changes
Include a text explaining if this is needed or it's handled internally by you and the promise is rejected when lastError
is set.
@piedrahitapablo Good observation. This library uses chrome-promise
, which rejects if lastError
is set.
This would be a great documentation PR. 😉