diff --git a/lib/storage/metadata/in_memory/metastore.js b/lib/storage/metadata/in_memory/metastore.js index 75905e670..ed9e62e00 100644 --- a/lib/storage/metadata/in_memory/metastore.js +++ b/lib/storage/metadata/in_memory/metastore.js @@ -26,18 +26,7 @@ function inc(str) { } const metastore = { - // Used for simulation of metadata errors. - error: () => {}, - - setErrorFunc(func) { - this.error = func; - return this; - }, - - clearErrorFunc() { - this.error = () => {}; - return this; - }, + errors: {}, // Used for simulation of metadata errors. createBucket: (bucketName, bucketMD, log, cb) => { process.nextTick(() => { @@ -94,9 +83,8 @@ const metastore = { }, putObject: (bucketName, objName, objVal, params, log, cb) => { - const err = metastore.error(metastore.putObject.name); - if (err) { - return process.nextTick(() => cb(err)); + if (metastore.errors.putObject) { + return process.nextTick(() => cb(metastore.errors.putObject)); } return process.nextTick(() => { metastore.getBucketAttributes(bucketName, log, err => { @@ -169,11 +157,7 @@ const metastore = { }, getObject: (bucketName, objName, params, log, cb) => { - const err = metastore.error(metastore.getObject.name, objName); - if (err) { - return process.nextTick(() => cb(err)); - } - return process.nextTick(() => { + process.nextTick(() => { metastore.getBucketAttributes(bucketName, log, err => { if (err) { return cb(err);