redisError.js 471 B

123456789101112131415161718192021222324
  1. 'use strict'
  2. var util = require('util')
  3. function RedisError (message, stack) {
  4. Object.defineProperty(this, 'message', {
  5. value: message || '',
  6. configurable: true,
  7. writable: true
  8. })
  9. if (stack || stack === undefined) {
  10. Error.captureStackTrace(this, RedisError)
  11. }
  12. }
  13. util.inherits(RedisError, Error)
  14. Object.defineProperty(RedisError.prototype, 'name', {
  15. value: 'RedisError',
  16. configurable: true,
  17. writable: true
  18. })
  19. module.exports = RedisError