Socket
Socket
Sign inDemoInstall

nice-grpc-web

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nice-grpc-web - npm Package Compare versions

Comparing version 3.2.1 to 3.2.2

31

lib/client/makeCall.js

@@ -45,13 +45,22 @@ "use strict";

}
async function* handleTransportErrors() {
try {
return yield* channel.transport({
url: channel.address + definition.path,
metadata: finalMetadata,
body: (0, encodeRequest_1.encodeRequest)({
request: interceptRequestError(),
encode: definition.requestSerialize,
}),
signal: innerAbortController.signal,
method: definition,
});
}
catch (err) {
(0, abort_controller_x_1.rethrowAbortError)(err);
throw new nice_grpc_common_1.ClientError(definition.path, nice_grpc_common_1.Status.UNKNOWN, `Transport error: ${(0, makeInternalErrorMessage_1.makeInternalErrorMessage)(err)}`);
}
}
const response = (0, decodeResponse_1.decodeResponse)({
response: channel.transport({
url: channel.address + definition.path,
metadata: finalMetadata,
body: (0, encodeRequest_1.encodeRequest)({
request: interceptRequestError(),
encode: definition.requestSerialize,
}),
signal: innerAbortController.signal,
method: definition,
}),
response: handleTransportErrors(),
decode: definition.responseDeserialize,

@@ -90,3 +99,3 @@ onHeader(header) {

if (status == null) {
throw new nice_grpc_common_1.ClientError(definition.path, nice_grpc_common_1.Status.INTERNAL, 'Server did not return a status');
throw new nice_grpc_common_1.ClientError(definition.path, nice_grpc_common_1.Status.UNKNOWN, 'Response stream closed without gRPC status');
}

@@ -93,0 +102,0 @@ else if (status !== nice_grpc_common_1.Status.OK) {

{
"name": "nice-grpc-web",
"version": "3.2.1",
"version": "3.2.2",
"description": "A Browser gRPC library that is nice to you",

@@ -86,3 +86,3 @@ "keywords": [

},
"gitHead": "02348455b53d8478dd84d2629a98bb37c28d0cd5"
"gitHead": "73c5c3c16e75b281b9f16b15b33f094f513b0939"
}

@@ -1,2 +0,2 @@

import {isAbortError} from 'abort-controller-x';
import {isAbortError, rethrowAbortError} from 'abort-controller-x';
import {CallOptions, ClientError, Metadata, Status} from 'nice-grpc-common';

@@ -66,13 +66,27 @@ import {MethodDefinition} from '../service-definitions';

async function* handleTransportErrors() {
try {
return yield* channel.transport({
url: channel.address + definition.path,
metadata: finalMetadata,
body: encodeRequest({
request: interceptRequestError(),
encode: definition.requestSerialize,
}),
signal: innerAbortController.signal,
method: definition,
});
} catch (err) {
rethrowAbortError(err);
throw new ClientError(
definition.path,
Status.UNKNOWN,
`Transport error: ${makeInternalErrorMessage(err)}`,
);
}
}
const response = decodeResponse({
response: channel.transport({
url: channel.address + definition.path,
metadata: finalMetadata,
body: encodeRequest({
request: interceptRequestError(),
encode: definition.requestSerialize,
}),
signal: innerAbortController.signal,
method: definition,
}),
response: handleTransportErrors(),
decode: definition.responseDeserialize,

@@ -115,4 +129,4 @@ onHeader(header) {

definition.path,
Status.INTERNAL,
'Server did not return a status',
Status.UNKNOWN,
'Response stream closed without gRPC status',
);

@@ -119,0 +133,0 @@ } else if (status !== Status.OK) {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc