pass error back to sync callback #78
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) {
|
function doGetSync(passedPassword, callback) {
|
||||||
const password = passedPassword === null || passedPassword === undefined ? '' : passedPassword;
|
const password = passedPassword === null || passedPassword === undefined ? '' : passedPassword;
|
||||||
|
|
||||||
function handleCallback() {
|
function handleCallback(error) {
|
||||||
if (callback) {
|
if (callback) {
|
||||||
if (typeof callback !== 'function') {
|
if (typeof callback !== 'function') {
|
||||||
throw new Error('Second argument passed to "doGetSync" must be a 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) {
|
export function doGetSync(passedPassword, callback) {
|
||||||
const password = passedPassword === null || passedPassword === undefined ? '' : passedPassword;
|
const password = passedPassword === null || passedPassword === undefined ? '' : passedPassword;
|
||||||
|
|
||||||
function handleCallback() {
|
function handleCallback(error) {
|
||||||
if (callback) {
|
if (callback) {
|
||||||
if (typeof callback !== 'function') {
|
if (typeof callback !== 'function') {
|
||||||
throw new Error('Second argument passed to "doGetSync" must be a function');
|
throw new Error('Second argument passed to "doGetSync" must be a function');
|
||||||
}
|
}
|
||||||
|
|
||||||
callback();
|
callback(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue