starpc 0.36.2 → 0.36.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/srpc/common-rpc.js +6 -1
- package/package.json +1 -1
- package/srpc/common-rpc.go +1 -1
- package/srpc/common-rpc.ts +5 -1
package/dist/srpc/common-rpc.js
CHANGED
|
@@ -148,7 +148,12 @@ export class CommonRPC {
|
|
|
148
148
|
}
|
|
149
149
|
this.closed = err ?? true;
|
|
150
150
|
// note: this does nothing if _source is already ended.
|
|
151
|
-
|
|
151
|
+
if (err && err.message) {
|
|
152
|
+
await this.writeCallData(undefined, true, err.message);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
await this.writeCallCancel();
|
|
156
|
+
}
|
|
152
157
|
this._source.end();
|
|
153
158
|
this._rpcDataSource.end(err);
|
|
154
159
|
}
|
package/package.json
CHANGED
package/srpc/common-rpc.go
CHANGED
|
@@ -116,7 +116,7 @@ func (c *commonRPC) ReadOne() ([]byte, error) {
|
|
|
116
116
|
|
|
117
117
|
// WriteCallData writes a call data packet.
|
|
118
118
|
func (c *commonRPC) WriteCallData(data []byte, complete bool, err error) error {
|
|
119
|
-
outPkt := NewCallDataPacket(data, len(data) == 0,
|
|
119
|
+
outPkt := NewCallDataPacket(data, len(data) == 0, complete, err)
|
|
120
120
|
return c.writer.WritePacket(outPkt)
|
|
121
121
|
}
|
|
122
122
|
|
package/srpc/common-rpc.ts
CHANGED
|
@@ -176,7 +176,11 @@ export class CommonRPC {
|
|
|
176
176
|
}
|
|
177
177
|
this.closed = err ?? true
|
|
178
178
|
// note: this does nothing if _source is already ended.
|
|
179
|
-
|
|
179
|
+
if (err && err.message) {
|
|
180
|
+
await this.writeCallData(undefined, true, err.message)
|
|
181
|
+
} else {
|
|
182
|
+
await this.writeCallCancel()
|
|
183
|
+
}
|
|
180
184
|
this._source.end()
|
|
181
185
|
this._rpcDataSource.end(err)
|
|
182
186
|
}
|