@sigodenjs/dee
Advanced tools
Comparing version 0.18.1 to 0.18.2
@@ -46,1 +46,9 @@ /// <reference types="node" /> | ||
export declare function resolveAsynRequestHandler(fn: AsyncRequestHandler): RequestHandler; | ||
export interface ErrItem { | ||
key: string; | ||
err: any; | ||
} | ||
export declare class DeeStopError extends Error { | ||
readonly errs: ErrItem[]; | ||
constructor(errs: ErrItem[]); | ||
} |
@@ -75,7 +75,16 @@ "use strict"; | ||
const stop = () => __awaiter(this, void 0, void 0, function* () { | ||
const errs = []; | ||
yield Promise.all(Object.keys(srvs).map((key) => __awaiter(this, void 0, void 0, function* () { | ||
if (srvs[key][dee_srv_1.STOP_KEY]) { | ||
yield srvs[key][dee_srv_1.STOP_KEY](); | ||
try { | ||
yield srvs[key][dee_srv_1.STOP_KEY](); | ||
} | ||
catch (err) { | ||
errs.push({ err, key }); | ||
} | ||
} | ||
}))); | ||
if (errs.length > 0) { | ||
throw new DeeStopError(errs); | ||
} | ||
}); | ||
@@ -98,2 +107,10 @@ const deeApp = { srvs, express: app, start, stop }; | ||
exports.resolveAsynRequestHandler = resolveAsynRequestHandler; | ||
class DeeStopError extends Error { | ||
constructor(errs) { | ||
super("dee cannot stop"); | ||
this.errs = errs; | ||
this.name = "DeeStopError"; | ||
} | ||
} | ||
exports.DeeStopError = DeeStopError; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@sigodenjs/dee", | ||
"version": "0.18.1", | ||
"version": "0.18.2", | ||
"description": "A framework focus on document driven design", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
11798
166