parserError.js 587 B

12345678910111213141516171819202122232425
  1. 'use strict'
  2. var util = require('util')
  3. var assert = require('assert')
  4. var RedisError = require('./redisError')
  5. var ADD_STACKTRACE = false
  6. function ParserError (message, buffer, offset) {
  7. assert(buffer)
  8. assert.strictEqual(typeof offset, 'number')
  9. RedisError.call(this, message, ADD_STACKTRACE)
  10. this.offset = offset
  11. this.buffer = buffer
  12. Error.captureStackTrace(this, ParserError)
  13. }
  14. util.inherits(ParserError, RedisError)
  15. Object.defineProperty(ParserError.prototype, 'name', {
  16. value: 'ParserError',
  17. configurable: true,
  18. writable: true
  19. })
  20. module.exports = ParserError