@heathmont/lab-flask
Advanced tools
Comparing version 0.1.13 to 0.1.14
@@ -14,3 +14,3 @@ export interface ParameterError { | ||
export declare const handleLabError: <T>(errorResponse: T, kind: any) => LabError; | ||
export declare const handleInteralError: (e: Error) => LabError; | ||
export declare const handleInternalError: (e: Error) => LabError; | ||
export {}; |
@@ -18,3 +18,2 @@ "use strict"; | ||
}; | ||
// Proto.Substance.Payments.Reaction.RequestPayment.Response.Error | ||
exports.handleLabError = (errorResponse, kind) => { | ||
@@ -30,8 +29,10 @@ const error = exports.createLabError(); | ||
}; | ||
exports.handleInteralError = (e) => { | ||
exports.handleInternalError = (e) => { | ||
const error = exports.createLabError('INTERNAL'); | ||
exports.addParameterError(error, 'message', e.message); | ||
exports.addParameterError(error, 'stack', e.stack); | ||
if (e.message) | ||
exports.addParameterError(error, 'message', e.message); | ||
if (e.stack) | ||
exports.addParameterError(error, 'stack', e.stack); | ||
return error; | ||
}; | ||
//# sourceMappingURL=errorHandler.js.map |
{ | ||
"name": "@heathmont/lab-flask", | ||
"version": "0.1.13", | ||
"version": "0.1.14", | ||
"author": "Margus Lamp", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
import { Proto } from '@heathmont/coingaming-protobuf'; | ||
import { createLabError, handleInteralError, handleLabError } from './errorHandler'; | ||
import { createLabError, handleInternalError, handleLabError } from './errorHandler'; | ||
@@ -30,3 +30,3 @@ describe('errorHandler', () => { | ||
it('should know how to create interal labError', () => { | ||
const error = handleInteralError(new Error('Error message')); | ||
const error = handleInternalError(new Error('Error message')); | ||
const errors = error.errors; | ||
@@ -33,0 +33,0 @@ expect(errors.length).toBe(2); |
@@ -33,4 +33,2 @@ export interface ParameterError { | ||
// Proto.Substance.Payments.Reaction.RequestPayment.Response.Error | ||
export const handleLabError = <T> (errorResponse: T, kind: any): LabError => { | ||
@@ -49,7 +47,7 @@ const error = createLabError(); | ||
export const handleInteralError = (e: Error): LabError => { | ||
export const handleInternalError = (e: Error): LabError => { | ||
const error = createLabError('INTERNAL'); | ||
addParameterError(error, 'message', e.message); | ||
addParameterError(error, 'stack', e.stack); | ||
if (e.message) addParameterError(error, 'message', e.message); | ||
if (e.stack) addParameterError(error, 'stack', e.stack); | ||
return error; | ||
}; |
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
95550