Ghost/core/server/storage/index.js
Sebastian Gierlinger fd0f5a5028 Add distinct error classes
closes #2690
- added new error classes
- moved errorhandling.js to /errors/index.js
- changed API errors to use new classes
- updated tests
2014-05-09 12:11:29 +02:00

22 lines
515 B
JavaScript

var errors = require('../errors'),
storage;
function get_storage() {
// TODO: this is where the check for storage apps should go
// Local file system is the default
var storageChoice = 'localfilesystem';
if (storage) {
return storage;
}
try {
// TODO: determine if storage has all the necessary methods
storage = require('./' + storageChoice);
} catch (e) {
errors.logError(e);
}
return storage;
}
module.exports.get_storage = get_storage;