Comparing version 1.0.0 to 1.0.1
@@ -9,2 +9,3 @@ "use strict"; | ||
const shortid_1 = require("shortid"); | ||
const isSocketResetError = require("is-socket-reset-error"); | ||
const util_1 = require("./util"); | ||
@@ -55,3 +56,3 @@ class ServiceInstance { | ||
}).on("error", err => { | ||
if (!util_1.isSocketResetError(err) && this.errorHandler) { | ||
if (!isSocketResetError(err) && this.errorHandler) { | ||
this.errorHandler.call(this, err); | ||
@@ -106,3 +107,3 @@ } | ||
}).on("error", err => { | ||
if (util_1.isSocketResetError(err)) { | ||
if (isSocketResetError(err)) { | ||
this.client.unref(); | ||
@@ -109,0 +110,0 @@ let times = 0; |
@@ -79,8 +79,2 @@ "use strict"; | ||
exports.proxify = proxify; | ||
function isSocketResetError(err) { | ||
return err instanceof Error | ||
&& (err["code"] == "ECONNRESET" | ||
|| /socket.*(ended|closed)/.test(err.message)); | ||
} | ||
exports.isSocketResetError = isSocketResetError; | ||
function absPath(filename) { | ||
@@ -87,0 +81,0 @@ if (!path.isAbsolute(filename)) { |
{ | ||
"name": "asrpc", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A tool to make your class as an RPC service.", | ||
@@ -30,2 +30,3 @@ "main": "dist/index.js", | ||
"fs-extra": "^7.0.0", | ||
"is-socket-reset-error": "^0.1.1", | ||
"object-hash": "^1.3.0", | ||
@@ -38,3 +39,6 @@ "shortid": "^2.2.13", | ||
"source-map-support": "^0.5.9" | ||
}, | ||
"engines": { | ||
"node": ">=6" | ||
} | ||
} |
@@ -220,3 +220,3 @@ # AS-RPC | ||
If any error occurred on the server side in a service, the error will be send | ||
back to the client, and it will be just like the error the occurred on the | ||
back to the client, and it will be just like the error that occurred on the | ||
client side, you will not see any difference between them, so just focus on | ||
@@ -223,0 +223,0 @@ your design as usual. |
@@ -6,2 +6,3 @@ import * as net from "net"; | ||
import { generate as uniqid } from "shortid"; | ||
import isSocketResetError = require("is-socket-reset-error"); | ||
import { | ||
@@ -15,3 +16,2 @@ getClassId, | ||
eventEmitter, | ||
isSocketResetError, | ||
absPath, | ||
@@ -18,0 +18,0 @@ classId |
@@ -95,8 +95,2 @@ import { generate as uniqid } from "shortid"; | ||
export function isSocketResetError(err) { | ||
return err instanceof Error | ||
&& (err["code"] == "ECONNRESET" | ||
|| /socket.*(ended|closed)/.test(err.message)); | ||
} | ||
export function absPath(filename: string): string { | ||
@@ -103,0 +97,0 @@ // resolve path to be absolute |
Sorry, the diff of this file is not supported yet
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
51689
9
779
+ Addedis-socket-reset-error@^0.1.1
+ Addedis-socket-reset-error@0.1.1(transitive)