Socket
Socket
Sign inDemoInstall

@c8/errors

Package Overview
Dependencies
56
Maintainers
6
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.0 to 0.2.1

12

lib/utils.js

@@ -60,5 +60,5 @@ 'use strict'

*/
const tryRequestPromiseErrorConversion = (err) => {
const tryRequestPromiseErrorConversion = err => {
// handle request-promise errors
if (err instanceof RequestPromiseErrors.RequestError) {
if (err instanceof RequestPromiseErrors.RequestError || err.name === 'RequestError') {
switch (err.cause.code) {

@@ -81,6 +81,6 @@ case 'ECONNREFUSED': {

}
} else if (err instanceof RequestPromiseErrors.StatusCodeError) {
} else if (err instanceof RequestPromiseErrors.StatusCodeError || err.name === 'StatusCodeError') {
switch (err.statusCode) {
case httpStatus.FORBIDDEN: return Boom.forbidden()
case httpStatus.UNAUTHORIZED: return Boom.unauthorized()
case httpStatus.FORBIDDEN: return Boom.forbidden(err.message)
case httpStatus.UNAUTHORIZED: return Boom.unauthorized(err.message)
}

@@ -135,3 +135,3 @@ }

*/
bookshelfToC8: (bookshelfErr) => {
bookshelfToC8: bookshelfErr => {
if (!(typeof bookshelfErr === 'object')) return new Error(bookshelfErr)

@@ -138,0 +138,0 @@ if (!bookshelfErr.code) return bookshelfErr

{
"name": "@c8/errors",
"version": "0.2.0",
"version": "0.2.1",
"description": "Common errors and their utils used by C8 management",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc