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

@fastify/error

Package Overview
Dependencies
Maintainers
17
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastify/error - npm Package Compare versions

Comparing version 3.2.1 to 3.3.0

21

index.js
'use strict'
const { inherits, format } = require('util')
const { format } = require('util')
function toString () {
return `${this.name} [${this.code}]: ${this.message}`
}
function createError (code, message, statusCode = 500, Base = Error) {

@@ -25,10 +29,15 @@ if (!code) throw new Error('Fastify error code must not be empty')

FastifyError.prototype = Object.create(Base.prototype, {
constructor: {
value: FastifyError,
enumerable: false,
writable: true,
configurable: true
}
})
FastifyError.prototype[Symbol.toStringTag] = 'Error'
FastifyError.prototype.toString = function () {
return `${this.name} [${this.code}]: ${this.message}`
}
FastifyError.prototype.toString = toString
inherits(FastifyError, Base)
return FastifyError

@@ -35,0 +44,0 @@ }

{
"name": "@fastify/error",
"version": "3.2.1",
"version": "3.3.0",
"description": "A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.",

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

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