ayva
Version:
Library for developing cross-platform voice applications
20 lines (17 loc) • 529 B
JavaScript
const Errors = require('.')
var ErrorManager = function(){
var ErrorHandlers = {}
return{
registerErrorHandlers: function(errorHandlers){
if(typeof(errorHandlers) !== 'object') throw new Error(Errors.ERR_REGISTRATION)
Object.assign(ErrorHandlers, errorHandlers)
},
getErrorHandler: function(name){
return ErrorHandlers[name];
},
getErrorHandlers: function(){
return ErrorHandlers;
}
}
}()
module.exports = ErrorManager