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

@golemio/errors

Package Overview
Dependencies
Maintainers
5
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@golemio/errors - npm Package Compare versions

Comparing version 1.0.2-dev.368844540 to 1.0.2-dev.693846341

7

dist/ErrorHandler.d.ts
import { CustomError, ICustomErrorObject } from "./";
import { ILogger, LogLevels } from "./Logger";
/**

@@ -16,7 +15,7 @@ * Class responsible for error handling in the app. Catches errors and based on their type performs some action.

* @param {Error|CustomError} err object to catch and process
* @param {LogLevels} logLevel log level method, default "error"
* @param {ILogger} logger logger function, default internal Logger
* @param {string} logLevel log level method, default "error"
* @param {fn} logger logger function
* @returns ICustomErrorObject
*/
static handle(err: Error | CustomError, logLevel?: LogLevels, logger?: ILogger): ICustomErrorObject;
static handle<Logger extends Record<any, any>>(err: Error | CustomError, logger: Logger, logLevel?: keyof Logger): ICustomErrorObject;
}

@@ -5,3 +5,2 @@ "use strict";

const _1 = require("./");
const Logger_1 = require("./Logger");
/**

@@ -20,7 +19,7 @@ * Class responsible for error handling in the app. Catches errors and based on their type performs some action.

* @param {Error|CustomError} err object to catch and process
* @param {LogLevels} logLevel log level method, default "error"
* @param {ILogger} logger logger function, default internal Logger
* @param {string} logLevel log level method, default "error"
* @param {fn} logger logger function
* @returns ICustomErrorObject
*/
static handle(err, logLevel = "error", logger = Logger_1.log) {
static handle(err, logger, logLevel = "error") {
if (err instanceof _1.CustomError && err.isOperational) {

@@ -27,0 +26,0 @@ // log level for operational error is set dynamically, default level is `error`

import { CustomError, ErrorHandler, ICustomErrorObject } from "./";
import { ILogger, LogLevels } from "./Logger";
/**

@@ -16,7 +15,7 @@ * Class responsible for error handling in the app. Catches errors and based on their type performs some action.

* @param {Error|CustomError} err object to catch and process
* @param {LogLevels} logLevel log level method, default "error"
* @param {ILogger} logger logger function, default internal Logger
* @param {fn} logger logger function
* @param {string} logLevel log level method, default "error"
* @returns ICustomErrorObject
*/
static handle(err: Error | CustomError, logLevel?: LogLevels, logger?: ILogger): ICustomErrorObject;
static handle<Logger extends Record<any, any>>(err: Error | CustomError, logger: Logger, logLevel?: keyof Logger): ICustomErrorObject;
}

@@ -5,3 +5,2 @@ "use strict";

const _1 = require("./");
const Logger_1 = require("./Logger");
/**

@@ -20,9 +19,9 @@ * Class responsible for error handling in the app. Catches errors and based on their type performs some action.

* @param {Error|CustomError} err object to catch and process
* @param {LogLevels} logLevel log level method, default "error"
* @param {ILogger} logger logger function, default internal Logger
* @param {fn} logger logger function
* @param {string} logLevel log level method, default "error"
* @returns ICustomErrorObject
*/
static handle(err, logLevel = "error", logger = Logger_1.log) {
static handle(err, logger, logLevel = "error") {
// Call super to handle non-operational error
const errObject = super.handle(err, logLevel, logger);
const errObject = super.handle(err, logger, logLevel);
let toReturn;

@@ -29,0 +28,0 @@ // Define what to return to user

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

{
"name": "@golemio/errors",
"version": "1.0.2-dev.368844540",
"description": "Library of Error classes of the Golemio Data Platform System",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"prepublishOnly": "tsc",
"build": "tsc",
"build-watch": "tsc --watch --preserveWatchOutput",
"test": "mocha --check-leaks --timeout 60000 -r ts-node/register -r dotenv/config --recursive test/*.test.ts --exit",
"test-debug": "mocha --inspect-brk=9230 -b --check-leaks --timeout 60000 -r ts-node/register -r dotenv/config --recursive test/*.test.ts --exit",
"code-coverage": "nyc mocha --check-leaks --timeout 60000 -r ts-node/register -r source-map-support/register -r dotenv/config --recursive test/*.test.ts --exit",
"lint": "tslint -p .",
"generate-docs": "typedoc --out docs/typedoc src"
},
"keywords": [],
"author": "Operator ICT, a.s.",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://gitlab.com/operator-ict/golemio/code/errors"
},
"devDependencies": {
"@types/chai": "^4.2.14",
"@types/chai-as-promised": "^7.1.3",
"@types/debug": "^4.1.5",
"@types/mocha": "^8.0.4",
"@types/node": "^12.12.6",
"@types/sinon": "^9.0.8",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"husky": "^4.3.0",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
"sinon": "^9.2.1",
"ts-node": "^9.0.0",
"tslint": "5.11.0",
"typedoc": "^0.20.28",
"typescript": "^4.0.5"
},
"dependencies": {
"debug": "^4.2.0",
"dotenv": "^8.2.0",
"winston": "^3.3.3"
},
"nyc": {
"check-coverage": true,
"extension": [
".ts",
".tsx"
],
"exclude": [
"**/*.d.ts",
"dist",
"**/*.test.ts",
"coverage",
"docs",
"node_modules",
"src/Logger.ts"
],
"reporter": [
"text",
"lcov"
],
"all": true,
"lines": 0,
"statements": 0,
"functions": 0,
"branches": 0
},
"husky": {
"hooks": {
"pre-commit": "npm run tslint"
}
}
"name": "@golemio/errors",
"version": "1.0.2-dev.693846341",
"description": "Library of Error classes of the Golemio Data Platform System",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"prepublishOnly": "tsc",
"build": "tsc",
"build-watch": "tsc --watch --preserveWatchOutput",
"test": "cross-env NODE_ENV=test TS_NODE_COMPILER='ttypescript' mocha --exit --check-leaks --timeout 120000 -r ts-node/register -r dotenv/config 'test/**/*.test.ts'",
"test-debug": "run-s 'test --inspect-brk=9230'",
"code-coverage": "nyc run-s 'test -r source-map-support/register'",
"lint": "tslint -p .",
"generate-docs": "typedoc --out docs/typedoc src"
},
"keywords": [],
"author": "Operator ICT, a.s.",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://gitlab.com/operator-ict/golemio/code/errors"
},
"devDependencies": {
"@types/chai": "^4.2.14",
"@types/chai-as-promised": "^7.1.3",
"@types/debug": "^4.1.5",
"@types/mocha": "^8.0.4",
"@types/node": "^12.12.6",
"@types/sinon": "^9.0.8",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"cross-env": "^7.0.3",
"husky": "^4.3.0",
"mocha": "^8.2.1",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"sinon": "^9.2.1",
"ts-node": "^10.9.1",
"tslint": "5.11.0",
"ttypescript": "^1.5.13",
"typedoc": "^0.22.15",
"typescript": "4.7.2"
},
"dependencies": {
"debug": "^4.2.0",
"dotenv": "^8.2.0",
"pino": "^8.7.0"
},
"nyc": {
"check-coverage": true,
"extension": [
".ts",
".tsx"
],
"exclude": [
"**/*.d.ts",
"dist",
"**/*.test.ts",
"coverage",
"docs",
"node_modules",
"src/Logger.ts"
],
"reporter": [
"text",
"lcov"
],
"all": true,
"lines": 0,
"statements": 0,
"functions": 0,
"branches": 0
},
"husky": {
"hooks": {
"pre-commit": "npm run lint"
}
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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