Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@octokit/rest

Package Overview
Dependencies
Maintainers
3
Versions
297
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/rest - npm Package Compare versions

Comparing version 14.0.8 to 14.0.9

lib/request/http-error.js

12

lib/plugins/endpoint-methods/validate.js

@@ -6,3 +6,3 @@ 'use strict'

const set = require('lodash/set')
const errors = require('../../request/errors')
const HttpError = require('../../request/http-error')

@@ -28,3 +28,3 @@ function validate (endpointParams, options) {

(parameter['allow-null'] === false && paramIsNull)) {
throw new errors.BadRequest(`Empty value for parameter '${parameterName}': ${value}`)
throw new HttpError(`Empty value for parameter '${parameterName}': ${value}`, 400)
}

@@ -34,3 +34,3 @@

if (parameter.enum.indexOf(value) === -1) {
throw new errors.BadRequest(`Invalid value for parameter '${parameterName}': ${value}`)
throw new HttpError(`Invalid value for parameter '${parameterName}': ${value}`, 400)
}

@@ -42,3 +42,3 @@ }

if (!regex.test(value)) {
throw new errors.BadRequest(`Invalid value for parameter '${parameterName}': ${value}`)
throw new HttpError(`Invalid value for parameter '${parameterName}': ${value}`, 400)
}

@@ -50,3 +50,3 @@ }

if (isNaN(value)) {
throw new errors.BadRequest(`Invalid value for parameter '${parameterName}': ${options[parameterName]} is NaN`)
throw new HttpError(`Invalid value for parameter '${parameterName}': ${options[parameterName]} is NaN`, 400)
}

@@ -59,3 +59,3 @@ }

} catch (exception) {
throw new errors.BadRequest(`JSON parse error of value for parameter '${parameterName}': ${value}`)
throw new HttpError(`JSON parse error of value for parameter '${parameterName}': ${value}`, 400)
}

@@ -62,0 +62,0 @@ }

module.exports = getPage
const errors = require('../../request/errors')
const HttpError = require('../../request/http-error')
const getPageLinks = require('./get-page-links')

@@ -15,3 +15,3 @@

if (!url) {
const urlError = new errors.NotFound(`No ${which} page found`)
const urlError = new HttpError(`No ${which} page found`, 404)
if (callback) {

@@ -18,0 +18,0 @@ return callback(urlError)

@@ -14,3 +14,3 @@ 'use strict'

const errors = require('./errors')
const HttpError = require('./http-error')

@@ -64,3 +64,3 @@ function httpRequest (requestOptions) {

response.on('error', (error) => {
reject(new errors.InternalServerError(error.message))
reject(new HttpError(error.message, 500))
})

@@ -75,3 +75,3 @@ response.on('end', () => {

if (response.statusCode === 304 || response.statusCode >= 400 || response.statusCode < 10) {
reject(new errors.HttpError(data, response.statusCode, response.headers))
reject(new HttpError(data, response.statusCode, response.headers))
return

@@ -96,3 +96,3 @@ }

debug('REQUEST ERROR: ' + error.message)
reject(new errors.InternalServerError(error.message))
reject(new HttpError(error.message, 500))
})

@@ -107,3 +107,3 @@

aborted = true
reject(new errors.GatewayTimeout('Request timeout'))
reject(new HttpError('Request timeout', 504))
})

@@ -110,0 +110,0 @@

{
"name": "@octokit/rest",
"version": "14.0.8",
"version": "14.0.9",
"publishConfig": {

@@ -40,8 +40,5 @@ "access": "public"

"debug": "^3.1.0",
"dotenv": "^4.0.0",
"https-proxy-agent": "^2.1.0",
"is-array-buffer": "^1.0.0",
"is-stream": "^1.1.0",
"lodash": "^4.17.4",
"proxy-from-env": "^1.0.0",
"url-template": "^2.0.8"

@@ -54,2 +51,3 @@ },

"coveralls": "^3.0.0",
"dotenv": "^5.0.0",
"gh-pages-with-token": "^1.0.0",

@@ -56,0 +54,0 @@ "glob": "^7.1.2",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc