@golemio/errors
Advanced tools
Comparing version 1.0.1-dev.333311734 to 1.0.1-dev.342794123
@@ -29,3 +29,3 @@ /** | ||
className?: string; | ||
/** Error code for better identifing type of error */ | ||
/** Error code for better identifying type of error */ | ||
code?: number; | ||
@@ -37,7 +37,8 @@ /** Additional info about error cause, parent error */ | ||
* | ||
* @param message Error message | ||
* @param {string} message Error message | ||
* @param {boolean} isOperational If the error is operational (runtime expected application error) | ||
* or not (unknown/fatal error, app should gracefully die on this). | ||
* @param code Error code | ||
* @param cause Cause of the error - parent error, parent context or similar | ||
* @param {string} className Name of class error is thrown from | ||
* @param {number} code Error code | ||
* @param {object} cause Cause of the error - parent error, parent context or similar | ||
*/ | ||
@@ -44,0 +45,0 @@ constructor(message: string, isOperational?: boolean, className?: string, code?: number, cause?: any); |
@@ -16,7 +16,8 @@ "use strict"; | ||
* | ||
* @param message Error message | ||
* @param {string} message Error message | ||
* @param {boolean} isOperational If the error is operational (runtime expected application error) | ||
* or not (unknown/fatal error, app should gracefully die on this). | ||
* @param code Error code | ||
* @param cause Cause of the error - parent error, parent context or similar | ||
* @param {string} className Name of class error is thrown from | ||
* @param {number} code Error code | ||
* @param {object} cause Cause of the error - parent error, parent context or similar | ||
*/ | ||
@@ -68,3 +69,3 @@ constructor(message, isOperational, className, code, cause) { | ||
causeToString(cause) { | ||
let info = null; | ||
let info; | ||
try { | ||
@@ -71,0 +72,0 @@ if (cause instanceof CustomError) { |
@@ -86,3 +86,3 @@ "use strict"; | ||
toReturn = { | ||
error_message: "Payload Too Large. Try using ?limit parameter with lower number, if aplicable.", | ||
error_message: "Payload Too Large. Try using ?limit parameter with lower number, if applicable.", | ||
error_status: 413, | ||
@@ -89,0 +89,0 @@ }; |
{ | ||
"name": "@golemio/errors", | ||
"version": "1.0.1-dev.333311734", | ||
"version": "1.0.1-dev.342794123", | ||
"description": "Library of Error classes of the Golemio Data Platform System", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
# Golemio Errors Library | ||
Minimal package with custom Error class extending the native built-in JavaScript `Error` class, providing extra funcionality and more capabilities for error handling. | ||
Minimal package with custom Error class extending the native built-in JavaScript `Error` class, providing extra functionality and more capabilities for error handling. | ||
@@ -5,0 +5,0 @@ Trying to adhere to [Node.js best practices](https://github.com/goldbergyoni/nodebestpractices#2-error-handling-practices). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
38627
516