@springworks/error-factory
Advanced tools
Comparing version 3005.162.3 to 3005.192.0
@@ -1,2 +0,2 @@ | ||
export declare type ClientHttpStatusCode = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 422 | 425 | 426 | 428 | 429 | 431 | 451; | ||
export type ClientHttpStatusCode = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 422 | 425 | 426 | 428 | 429 | 431 | 451; | ||
export interface ErrorResponse { | ||
@@ -3,0 +3,0 @@ error: { |
@@ -5,3 +5,5 @@ import { Output } from '@hapi/boom'; | ||
export declare function isJoi(error: unknown): boolean; | ||
export declare function toStringDebug(this: any): string; | ||
export declare function toStringDebug(this: FelError & { | ||
annotate?: () => string; | ||
}): string; | ||
export interface ValidationDetail { | ||
@@ -8,0 +10,0 @@ message: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isFelError = exports.createError = exports.toStringDebug = exports.isJoi = exports.getRootErrorId = exports.getStatusCode = void 0; | ||
const http_1 = require("http"); | ||
const util_1 = require("util"); | ||
const boom_1 = require("@hapi/boom"); | ||
const random_string_1 = require("@springworks/random-string"); | ||
const http_1 = require("http"); | ||
const util_1 = require("util"); | ||
function getStatusCode(code, cause) { | ||
@@ -43,4 +43,5 @@ var _a; | ||
function toStringDebug() { | ||
var _a; | ||
const has_annotate = typeof this.annotate === 'function'; | ||
const details = has_annotate ? this.annotate() : (0, util_1.format)(' %j', this.output.payload); | ||
const details = has_annotate ? this.annotate() : (0, util_1.format)(' %j', (_a = this.output) === null || _a === void 0 ? void 0 : _a.payload); | ||
return `Error: ${String(this.code)} ${String(this.message)}:\n${String(details)}`; | ||
@@ -47,0 +48,0 @@ } |
@@ -10,3 +10,3 @@ "use strict"; | ||
set: (0, util_1.deprecate)((value) => { | ||
log_payload = log_payload || []; | ||
log_payload = Array.isArray(log_payload) ? log_payload : []; | ||
log_payload.push(value); | ||
@@ -13,0 +13,0 @@ }, 'do not set error.payload'), |
{ | ||
"name": "@springworks/error-factory", | ||
"version": "3005.162.3", | ||
"version": "3005.192.0", | ||
"description": "Custom error that makes use of HTTP error codes to identify different error types.", | ||
@@ -28,3 +28,3 @@ "main": "build/main.js", | ||
"homepage": "https://github.com/Springworks/m2h-mono/tree/master/packages/error-factory#readme", | ||
"gitHead": "4e1e40743bced8c77cd2aaf6d691bc5e23ebba59" | ||
"gitHead": "990085cde7220b1ba2c2506d7aee3ccf6502ffff" | ||
} |
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33601
299