Skip to content

Commit

Permalink
1.0.7, remove dependency on Error.captureStackTrace()
Browse files Browse the repository at this point in the history
  • Loading branch information
Igrom committed Jan 7, 2022
1 parent 4092189 commit 03f16c5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [1.0.7] - 2022-01-07
### Fix
- Remove dependency on non-standard Error.captureStackTrace() method

## [1.0.6] - 2021-03-16
### Fix
- Applying security vulnerabilities patches
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cimpress-fulfillment-location",
"version": "1.0.6",
"author": "LogisticsQuotingandPlanning@cimpress.com",
"version": "1.0.7",
"author": "TrdelnikSquad@cimpress.com",
"description": "A simple client for the Cimpress Fulfillment Location service",
"license": "Apache-2.0",
"repository": {
Expand Down
30 changes: 15 additions & 15 deletions src/fulfillmentLocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ let axios = require('axios');
// --- Predefined errors ---

function UnauthorizedError(message, extra) {
Error.captureStackTrace(this, this.constructor);
this.name = 'UnauthorizedError';
this.message = message || 'Unauthorized';
this.status = 401;
this.additionalData = extra;
let error = new Error(message || 'Unauthorized');
error.name = 'UnauthorizedError';
error.status = 401;
error.additionalData = extra;
return error;
}

function ForbiddenError(message, extra) {
Error.captureStackTrace(this, this.constructor);
this.name = 'ForbiddenError';
this.message = message || 'Forbidden';
this.status = 403;
this.additionalData = extra;
let error = new Error(message || 'Forbidden');
error.name = 'ForbiddenError';
error.status = 403;
error.additionalData = extra;
return error;
}

function NotFoundError(message, extra) {
Error.captureStackTrace(this, this.constructor);
this.name = 'NotFoundError';
this.message = message || 'Not found';
this.status = 404;
this.additionalData = extra;
let error = new Error(message || 'Not found');
error.name = 'NotFoundError';
error.status = 404;
error.additionalData = extra;
return error;
}

// --- END ---
Expand Down

0 comments on commit 03f16c5

Please sign in to comment.