/** * Created by benzhan on 15/8/25. */ var util = require('util'); function AbstractError(msg, constr) { Error.captureStackTrace(this, constr || this); this.message = msg || 'Error' } util.inherits(AbstractError, Error); AbstractError.prototype.name = 'Abstract Error'; /** * 中断(正常停止) * @param msg * @constructor */ function Interrupt(msg) { Interrupt.super_.call(this, msg, this.constructor) } util.inherits(Interrupt, AbstractError); Interrupt.prototype.name = 'Interrupt'; /** * 数据库错误 * @param msg * @constructor */ function DbError(msg) { DbError.super_.call(this, msg, this.constructor) } util.inherits(DbError, AbstractError); DbError.prototype.name = 'Database Error'; /** * Redis错误 * @param msg * @constructor */ function RedisError(msg) { RedisError.super_.call(this, msg, this.constructor) } util.inherits(RedisError, AbstractError); RedisError.prototype.name = 'Redis Error'; module.exports = { Interrupt: Interrupt, DbError: DbError, RedisError: RedisError };