grpc-shared
Advanced tools
Comparing version 1.0.27 to 1.0.28
@@ -6,1 +6,2 @@ export declare const BAD_REQUEST = "BAD_REQUEST"; | ||
export declare const UNHANDELED = "UNHANDELED"; | ||
export declare const INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.UNHANDELED = exports.RESOURCE_NOT_FOUND = exports.UNAUTHENTICATED = exports.UNAUTHORIZED = exports.BAD_REQUEST = void 0; | ||
exports.INTERNAL_SERVER_ERROR = exports.UNHANDELED = exports.RESOURCE_NOT_FOUND = exports.UNAUTHENTICATED = exports.UNAUTHORIZED = exports.BAD_REQUEST = void 0; | ||
exports.BAD_REQUEST = 'BAD_REQUEST'; | ||
@@ -9,1 +9,2 @@ exports.UNAUTHORIZED = 'UNAUTHORIZED'; | ||
exports.UNHANDELED = "UNHANDELED"; | ||
exports.INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR"; |
@@ -20,7 +20,8 @@ "use strict"; | ||
return next.handle().pipe((0, operators_1.catchError)((err) => { | ||
var _a, _b; | ||
const message = grpc_exceptions_1.GrpcException.composeLocalizedMessage("Unkown Error"); | ||
const service = process.env.npm_package_name; | ||
const generatedMetadata = grpc_exceptions_1.GrpcException.generateExceptionMetadata(error_codes_1.UNHANDELED, message, service); | ||
let metadata = err.metadata; | ||
let code = err.code; | ||
let metadata = err.metadata || ((_a = err === null || err === void 0 ? void 0 : err.error) === null || _a === void 0 ? void 0 : _a.metadata); | ||
let code = err.code || ((_b = err === null || err === void 0 ? void 0 : err.code) === null || _b === void 0 ? void 0 : _b.code); | ||
if (!err.metadata) { | ||
@@ -27,0 +28,0 @@ metadata = generatedMetadata; |
{ | ||
"name": "grpc-shared", | ||
"version": "1.0.27", | ||
"version": "1.0.28", | ||
"description": "shared logic between services", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
16776
355