Merge branch 'master' of github.com:PhilipMantrov/nest into PhilipMantrov-master

This commit is contained in:
Kamil Myśliwiec
2022-09-19 14:59:40 +02:00
5 changed files with 16 additions and 14 deletions

View File

@@ -46,7 +46,7 @@ export class ClientGrpcProxy extends ClientProxy implements ClientGrpc {
const grpcClient = this.createClientByServiceName(name);
const clientRef = this.getClient(name);
if (!clientRef) {
throw new InvalidGrpcServiceException();
throw new InvalidGrpcServiceException(name);
}
const protoMethods = Object.keys(clientRef[name].prototype);
@@ -65,7 +65,7 @@ export class ClientGrpcProxy extends ClientProxy implements ClientGrpc {
public createClientByServiceName(name: string) {
const clientRef = this.getClient(name);
if (!clientRef) {
throw new InvalidGrpcServiceException();
throw new InvalidGrpcServiceException(name);
}
const channelOptions: ChannelOptions =
@@ -270,7 +270,9 @@ export class ClientGrpcProxy extends ClientProxy implements ClientGrpc {
const grpcPkg = this.lookupPackage(grpcContext, packageName);
if (!grpcPkg) {
const invalidPackageError = new InvalidGrpcPackageException();
const invalidPackageError = new InvalidGrpcPackageException(
packageName,
);
this.logger.error(
invalidPackageError.message,
invalidPackageError.stack,
@@ -295,7 +297,7 @@ export class ClientGrpcProxy extends ClientProxy implements ClientGrpc {
grpcPackage.loadPackageDefinition(packageDefinition);
return packageObject;
} catch (err) {
const invalidProtoError = new InvalidProtoDefinitionException();
const invalidProtoError = new InvalidProtoDefinitionException(err.path);
const message =
err && err.message ? err.message : invalidProtoError.message;