Skip to content
This repository was archived by the owner on Dec 27, 2024. It is now read-only.

Commit 715b02f

Browse files
committed
merge v0.21.1
2 parents c4789c9 + 86e0a01 commit 715b02f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sakuraapi/core",
3-
"version": "0.21.0",
3+
"version": "0.21.1",
44
"description": "MongoDB and TypeScript MEAN Stack Framework for NodeJS",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",

src/core/sakura-api.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ export class SakuraApi {
256256
// emitters
257257
private closed$ = new Subject<void>();
258258
private listening$ = new Subject<void>();
259-
259+
260260
/**
261261
* Returns the address of the server as a string.
262262
*/
@@ -337,7 +337,7 @@ export class SakuraApi {
337337

338338
this.config = (!options.config)
339339
? new SakuraApiConfig().load(options.configPath) || {}
340-
: options.configPath;
340+
: options.config;
341341

342342
this._dbConnections = (options.dbConfig)
343343
? this._dbConnections = options.dbConfig
@@ -418,7 +418,8 @@ export class SakuraApi {
418418

419419
return new Promise<void>((resolve, reject) => {
420420
this.server.close((err) => {
421-
if (err && err.message !== 'Not running') {
421+
const notRunningErr = err && ((!err.code && err.message === 'Not running') || err.code === 'ERR_SERVER_NOT_RUNNING');
422+
if (err && !notRunningErr) {
422423
debug.normal(`.close error`, err);
423424
this.closed$.next();
424425
reject(err);

0 commit comments

Comments
 (0)