modified configuration file for web

Signed-off-by: ajeetraina <ajeetraina@gmail.com>
This commit is contained in:
ajeetraina
2022-03-13 13:09:07 +05:30
parent 62bef58719
commit 7770fe6e3f
369 changed files with 64621 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
# IntelliJ project files
.idea
*.iml
out
gen
# Irrelevant files and folders
benchmark
coverage
test
.travis.yml
.gitignore
*.log
.vscode
.codeclimate.yml

View File

@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2017 Ruben Bridgewater
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,116 @@
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
# redis-errors
All error classes used in [node_redis](https://github.com/NodeRedis/node_redis)
from v.3.0.0 are in here. They can be required as needed.
## Install
Install with [NPM](https://npmjs.org/):
npm install redis-errors
## Usage
```js
const { ReplyError, InterruptError } = require('redis-errors');
// Using async await
try {
await client.set('foo') // Missing value
} catch (err) {
if (err instanceof InterruptError) {
console.error('Command might have been processed')
}
if (err instanceof ReplyError) {
// ...
}
throw err
}
// Using callbacks
client.set('foo', (err, res) => {
if (err) {
if (err instanceof InterruptError) {
// ...
}
}
})
```
### Error classes
All errors returned by NodeRedis use own Error classes. You can distinguish
different errors easily by checking for these classes.
To know what caused the error they might contain properties to know in more
detail what happened.
Each error contains a `message`, a `name` and a `stack` property. Please be aware
that the stack might not be useful due to the async nature and is in those cases
therefore limited to two frames.
There might be more not yet documented properties as well. Please feel free to
open a pull request to document those as well.
#### RedisError
`Properties`:
Properties depend on the individual error.
All errors returned by NodeRedis (client) are `RedisError`s.
Subclass of `Error`
#### ReplyError
`Properties`:
* `args`: The arguments passed to the command.
* `command`: The command name.
* `code`: The `Redis` error code. Redis itself uses some internal error codes.
All errors returned by Redis itself (server) will be a `ReplyError`.
Subclass of `RedisError`
#### ParserError
`Properties`:
* `buffer`: The raw buffer input stringified.
* `offset`: The character count where the parsing error occurred.
Parsing errors are returned as `ParserError`.
Subclass of `RedisError`
**Note:** If you encounter one of these please report that error including the
attached `offset` and `buffer` properties!
#### AbortError
`Properties`:
* `args`: The arguments passed to the command.
* `command`: The command name.
If a command was not yet executed but rejected, it'll return a `AbortError`.
Subclass of `RedisError`
#### InterruptError
`Properties`:
* `args`: The arguments passed to the command.
* `command`: The command name.
* `origin`: The original error that caused the interrupt
All executed commands that could not fulfill (e.g. network drop while
executing) return a `InterruptError`.
Subclass of `AbortError`
**Note:** Interrupt errors can happen for multiple reasons that are out of the
scope of NodeRedis itself. There is nothing that can be done on library side
to prevent those.
## License
[MIT](./LICENSE)

View File

@@ -0,0 +1,7 @@
'use strict'
const Errors = process.version.charCodeAt(1) < 55 && process.version.charCodeAt(2) === 46
? require('./lib/old') // Node.js < 7
: require('./lib/modern')
module.exports = Errors

View File

@@ -0,0 +1,59 @@
'use strict'
const assert = require('assert')
class RedisError extends Error {
get name () {
return this.constructor.name
}
}
class ParserError extends RedisError {
constructor (message, buffer, offset) {
assert(buffer)
assert.strictEqual(typeof offset, 'number')
const tmp = Error.stackTraceLimit
Error.stackTraceLimit = 2
super(message)
Error.stackTraceLimit = tmp
this.offset = offset
this.buffer = buffer
}
get name () {
return this.constructor.name
}
}
class ReplyError extends RedisError {
constructor (message) {
const tmp = Error.stackTraceLimit
Error.stackTraceLimit = 2
super(message)
Error.stackTraceLimit = tmp
}
get name () {
return this.constructor.name
}
}
class AbortError extends RedisError {
get name () {
return this.constructor.name
}
}
class InterruptError extends AbortError {
get name () {
return this.constructor.name
}
}
module.exports = {
RedisError,
ParserError,
ReplyError,
AbortError,
InterruptError
}

View File

@@ -0,0 +1,119 @@
'use strict'
const assert = require('assert')
const util = require('util')
// RedisError
function RedisError (message) {
Object.defineProperty(this, 'message', {
value: message || '',
configurable: true,
writable: true
})
Error.captureStackTrace(this, this.constructor)
}
util.inherits(RedisError, Error)
Object.defineProperty(RedisError.prototype, 'name', {
value: 'RedisError',
configurable: true,
writable: true
})
// ParserError
function ParserError (message, buffer, offset) {
assert(buffer)
assert.strictEqual(typeof offset, 'number')
Object.defineProperty(this, 'message', {
value: message || '',
configurable: true,
writable: true
})
const tmp = Error.stackTraceLimit
Error.stackTraceLimit = 2
Error.captureStackTrace(this, this.constructor)
Error.stackTraceLimit = tmp
this.offset = offset
this.buffer = buffer
}
util.inherits(ParserError, RedisError)
Object.defineProperty(ParserError.prototype, 'name', {
value: 'ParserError',
configurable: true,
writable: true
})
// ReplyError
function ReplyError (message) {
Object.defineProperty(this, 'message', {
value: message || '',
configurable: true,
writable: true
})
const tmp = Error.stackTraceLimit
Error.stackTraceLimit = 2
Error.captureStackTrace(this, this.constructor)
Error.stackTraceLimit = tmp
}
util.inherits(ReplyError, RedisError)
Object.defineProperty(ReplyError.prototype, 'name', {
value: 'ReplyError',
configurable: true,
writable: true
})
// AbortError
function AbortError (message) {
Object.defineProperty(this, 'message', {
value: message || '',
configurable: true,
writable: true
})
Error.captureStackTrace(this, this.constructor)
}
util.inherits(AbortError, RedisError)
Object.defineProperty(AbortError.prototype, 'name', {
value: 'AbortError',
configurable: true,
writable: true
})
// InterruptError
function InterruptError (message) {
Object.defineProperty(this, 'message', {
value: message || '',
configurable: true,
writable: true
})
Error.captureStackTrace(this, this.constructor)
}
util.inherits(InterruptError, AbortError)
Object.defineProperty(InterruptError.prototype, 'name', {
value: 'InterruptError',
configurable: true,
writable: true
})
module.exports = {
RedisError,
ParserError,
ReplyError,
AbortError,
InterruptError
}

View File

@@ -0,0 +1,69 @@
{
"_from": "redis-errors@^1.2.0",
"_id": "redis-errors@1.2.0",
"_inBundle": false,
"_integrity": "sha1-62LSrbFeTq9GEMBK/hUpOEJQq60=",
"_location": "/redis-errors",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "redis-errors@^1.2.0",
"name": "redis-errors",
"escapedName": "redis-errors",
"rawSpec": "^1.2.0",
"saveSpec": null,
"fetchSpec": "^1.2.0"
},
"_requiredBy": [
"/redis",
"/redis-parser"
],
"_resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz",
"_shasum": "eb62d2adb15e4eaf4610c04afe1529384250abad",
"_spec": "redis-errors@^1.2.0",
"_where": "/Users/ajeetraina/projects/13march/awesome-compose/nginx-nodejs-redis/web/node_modules/redis",
"author": {
"name": "Ruben Bridgewater"
},
"bugs": {
"url": "https://github.com/NodeRedis/redis-errors/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Error classes used in node_redis",
"devDependencies": {
"istanbul": "^0.4.0",
"mocha": "^3.1.2",
"standard": "^10.0.0"
},
"directories": {
"test": "test",
"lib": "lib"
},
"engines": {
"node": ">=4"
},
"homepage": "https://github.com/NodeRedis/redis-errors#readme",
"keywords": [
"redis",
"javascript",
"node",
"error"
],
"license": "MIT",
"main": "index.js",
"name": "redis-errors",
"repository": {
"type": "git",
"url": "git+https://github.com/NodeRedis/redis-errors.git"
},
"scripts": {
"coverage": "node ./node_modules/istanbul/lib/cli.js cover --preserve-comments ./node_modules/mocha/bin/_mocha -- -R spec",
"coverage:check": "node ./node_modules/istanbul/lib/cli.js check-coverage --statement 100",
"lint": "standard --fix",
"posttest": "npm run lint && npm run coverage:check",
"test": "npm run coverage"
},
"version": "1.2.0"
}