Skip to content

Commit

Permalink
Merge pull request #26 from snyk-tech-services/develop
Browse files Browse the repository at this point in the history
RELEASE
  • Loading branch information
lili2311 committed Oct 8, 2020
2 parents 5098081 + 972d9e0 commit 48ab93e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"dependencies": {
"@snyk/configstore": "^3.2.0-rc1",
"@types/uuid": "^7.0.3",
"axios": "^0.19.2",
"axios": "^0.20.0",
"chalk": "^4.0.0",
"debug": "^4.1.1",
"leaky-bucket-queue": "0.0.2",
Expand Down
6 changes: 5 additions & 1 deletion src/lib/customErrors/requestManagerErrors.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import * as debugModule from 'debug';

import {ApiError,
ApiAuthenticationError,
NotFoundError,
GenericError
} from './apiError'
const debug = debugModule('snyk')

const requestsManagerErrorOverload = (err: Error, channel: string, requestId: string): Error => {
debug('ERROR:', err);
switch(err?.name){
case 'ApiError':
return new RequestsManagerApiError(err.message, channel, requestId)
Expand Down Expand Up @@ -72,4 +76,4 @@ export {
RequestsManagerNotFoundError,
RequestsManagerGenericError,
requestsManagerErrorOverload
}
}
4 changes: 2 additions & 2 deletions src/lib/error.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as chalk from 'chalk'
const debugModule = require('debug');
import debugModule = require('debug');


const handleError = (error: Error) => {
Expand Down Expand Up @@ -30,4 +30,4 @@ const handleError = (error: Error) => {
}
}

export default handleError
export default handleError

0 comments on commit 48ab93e

Please sign in to comment.