mirror of https://github.com/grpc/grpc-node.git
grpc-js: Return never from functions that always throw
This commit is contained in:
parent
c1d68a00ac
commit
a3ecb45132
|
@ -173,7 +173,7 @@ class InsecureChannelCredentialsImpl extends ChannelCredentials {
|
|||
super(callCredentials);
|
||||
}
|
||||
|
||||
compose(callCredentials: CallCredentials): ChannelCredentials {
|
||||
compose(callCredentials: CallCredentials): never {
|
||||
throw new Error('Cannot compose insecure credentials');
|
||||
}
|
||||
|
||||
|
|
|
@ -207,13 +207,13 @@ export type Call =
|
|||
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
|
||||
export const loadObject = (value: any, options: any) => {
|
||||
export const loadObject = (value: any, options: any): never => {
|
||||
throw new Error(
|
||||
'Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead'
|
||||
);
|
||||
};
|
||||
|
||||
export const load = (filename: any, format: any, options: any) => {
|
||||
export const load = (filename: any, format: any, options: any): never => {
|
||||
throw new Error(
|
||||
'Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead'
|
||||
);
|
||||
|
|
|
@ -312,7 +312,7 @@ export class ResolvingLoadBalancer implements LoadBalancer {
|
|||
updateAddressList(
|
||||
addressList: SubchannelAddress[],
|
||||
lbConfig: LoadBalancingConfig | null
|
||||
) {
|
||||
): never {
|
||||
throw new Error('updateAddressList not supported on ResolvingLoadBalancer');
|
||||
}
|
||||
|
||||
|
|
|
@ -231,7 +231,7 @@ export class Server {
|
|||
}
|
||||
|
||||
|
||||
addProtoService(): void {
|
||||
addProtoService(): never {
|
||||
throw new Error('Not implemented. Use addService() instead');
|
||||
}
|
||||
|
||||
|
@ -311,7 +311,7 @@ export class Server {
|
|||
});
|
||||
}
|
||||
|
||||
bind(port: string, creds: ServerCredentials): void {
|
||||
bind(port: string, creds: ServerCredentials): never {
|
||||
throw new Error('Not implemented. Use bindAsync() instead');
|
||||
}
|
||||
|
||||
|
@ -696,7 +696,7 @@ export class Server {
|
|||
}
|
||||
}
|
||||
|
||||
addHttp2Port(): void {
|
||||
addHttp2Port(): never {
|
||||
throw new Error('Not yet implemented');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue