@firstfleet/fferrorhandler
Advanced tools
| import {SlackChannels, HttpErrorOptions} from './types' | ||
| declare class OperationalError extends Error { | ||
| constructor(message: string, data?: string, options?: {includeBody: boolean}) | ||
| } | ||
| declare class NonOperationalError extends Error { | ||
| constructor(message: string, data?: string, slackChannel?: SlackChannels, options?: {includeBody: boolean}) | ||
| } | ||
| declare class HttpError extends OperationalError { | ||
| constructor(message: string, statusCode: number, data?: string, options?: HttpErrorOptions) | ||
| } | ||
| export { | ||
| OperationalError, | ||
| NonOperationalError, | ||
| HttpError | ||
| } |
| import { SlackChannels } from './types' | ||
| export function logAndNotify(appName: string, methodName: string, message: string, messageDetail: string, slackChannel?: SlackChannels): void |
| import {NonOperationalError, OperationalError, HttpError} from './errorTypes' | ||
| import {Request, Response, NextFunction} from 'express' | ||
| declare function _isSlackChannelValid(slackChannel: string): boolean | ||
| declare function _getNonOperationalSlackChannel(error: NonOperationalError): string | ||
| declare function expressLogErrors(error: NonOperationalError | OperationalError | HttpError, req: Request, res: Response, NextFunction: NextFunction): Promise<void> | ||
| declare function expressHandleErrors(error: OperationalError | HttpError, req: Request, res: Response, next: NextFunction): Promise<void> | ||
| export { | ||
| _isSlackChannelValid, | ||
| _getNonOperationalSlackChannel, | ||
| expressLogErrors, | ||
| expressHandleErrors | ||
| } |
+35
| import * as ErrorTypes from './errorTypes'; | ||
| import * as Handler from './handler'; | ||
| import * as Middleware from './middleware'; | ||
| import constants from './constants' | ||
| /** | ||
| * @see {@link constants.errorLevels} | ||
| */ | ||
| type ErrorLevels = 'common' | 'critical' | 'fatal' | ||
| /** | ||
| * @see {@link constants.slackChannels} | ||
| */ | ||
| type SlackChannels = 'alerts_dev' | 'alerts_critical' | 'alerts_mobileapp' | | ||
| 'alerts_nodejobs' | 'alerts_sql' | 'alerts_warning' | 'alerts_web' | 'alerts_workflow' | 'alerts_mobilecomm' | ||
| /**Slack Error Options */ | ||
| type SlackErrorOptions = {channel: SlackChannels, send: boolean} | ||
| /**Http Error Options */ | ||
| type HttpErrorOptions = {includeBody: boolean, slack: SlackErrorOptions} | ||
| export { | ||
| ErrorLevels, | ||
| SlackChannels, | ||
| SlackErrorOptions, | ||
| HttpErrorOptions, | ||
| ErrorTypes, | ||
| Handler, | ||
| Middleware | ||
| } |
+4
-3
| { | ||
| "name": "@firstfleet/fferrorhandler", | ||
| "version": "2.1.3", | ||
| "version": "2.1.4", | ||
| "description": "handle errors", | ||
@@ -11,3 +11,3 @@ "main": "index.js", | ||
| "scripts": { | ||
| "send": "npm publish --access public", | ||
| "send": "npm publish", | ||
| "build-docs": "documentation build index.js -f md --shallow -o docs.md", | ||
@@ -35,3 +35,4 @@ "test": "jest", | ||
| "jest": "^29.2.1" | ||
| } | ||
| }, | ||
| "types": "types.d.ts" | ||
| } |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
75954
3.24%19
26.67%1101
4.96%1
Infinity%