pass error back to sync callback
This commit is contained in:
parent
4cb26d8184
commit
dd4d01b42b
2 changed files with 4 additions and 4 deletions
4
dist/bundle.es.js
vendored
4
dist/bundle.es.js
vendored
|
@ -2502,13 +2502,13 @@ function doSetSync(oldHash, newHash, data) {
|
|||
function doGetSync(passedPassword, callback) {
|
||||
const password = passedPassword === null || passedPassword === undefined ? '' : passedPassword;
|
||||
|
||||
function handleCallback() {
|
||||
function handleCallback(error) {
|
||||
if (callback) {
|
||||
if (typeof callback !== 'function') {
|
||||
throw new Error('Second argument passed to "doGetSync" must be a function');
|
||||
}
|
||||
|
||||
callback();
|
||||
callback(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -80,13 +80,13 @@ export function doSetSync(oldHash, newHash, data) {
|
|||
export function doGetSync(passedPassword, callback) {
|
||||
const password = passedPassword === null || passedPassword === undefined ? '' : passedPassword;
|
||||
|
||||
function handleCallback() {
|
||||
function handleCallback(error) {
|
||||
if (callback) {
|
||||
if (typeof callback !== 'function') {
|
||||
throw new Error('Second argument passed to "doGetSync" must be a function');
|
||||
}
|
||||
|
||||
callback();
|
||||
callback(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue