123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- /**
- * 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
- };
|