diff --git a/src/lib/customErrors/requestManagerErrors.ts b/src/lib/customErrors/requestManagerErrors.ts index 6c2f20d..d7bc373 100644 --- a/src/lib/customErrors/requestManagerErrors.ts +++ b/src/lib/customErrors/requestManagerErrors.ts @@ -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) @@ -72,4 +76,4 @@ export { RequestsManagerNotFoundError, RequestsManagerGenericError, requestsManagerErrorOverload -} \ No newline at end of file +} diff --git a/src/lib/error.ts b/src/lib/error.ts index 51331e4..5ad9342 100644 --- a/src/lib/error.ts +++ b/src/lib/error.ts @@ -1,5 +1,5 @@ import * as chalk from 'chalk' -const debugModule = require('debug'); +import debugModule = require('debug'); const handleError = (error: Error) => { @@ -30,4 +30,4 @@ const handleError = (error: Error) => { } } -export default handleError \ No newline at end of file +export default handleError