mirror of https://github.com/grpc/grpc-node.git
Merge pull request #1675 from murgatroid99/grpc-js-xds_error_logging
grpc-js-xds: Bubble up xds client initialization error details
This commit is contained in:
commit
98376f0ac6
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@grpc/grpc-js-xds",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"description": "Plugin for @grpc/grpc-js. Adds the xds:// URL scheme and associated features.",
|
||||
"main": "build/src/index.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -39,12 +39,12 @@ class XdsResolver implements Resolver {
|
|||
private channelOptions: ChannelOptions
|
||||
) {}
|
||||
|
||||
private reportResolutionError() {
|
||||
private reportResolutionError(reason: string) {
|
||||
this.listener.onError({
|
||||
code: status.UNAVAILABLE,
|
||||
details: `xDS name resolution failed for target ${uriToString(
|
||||
this.target
|
||||
)}`,
|
||||
)}: ${reason}`,
|
||||
metadata: new Metadata(),
|
||||
});
|
||||
}
|
||||
|
@ -68,12 +68,12 @@ class XdsResolver implements Resolver {
|
|||
* not already provided a ServiceConfig for the upper layer to use */
|
||||
if (!this.hasReportedSuccess) {
|
||||
trace('Resolution error for target ' + uriToString(this.target) + ' due to xDS client transient error ' + error.details);
|
||||
this.reportResolutionError();
|
||||
this.reportResolutionError(error.details);
|
||||
}
|
||||
},
|
||||
onResourceDoesNotExist: () => {
|
||||
trace('Resolution error for target ' + uriToString(this.target) + ': resource does not exist');
|
||||
this.reportResolutionError();
|
||||
this.reportResolutionError("Resource does not exist");
|
||||
},
|
||||
},
|
||||
this.channelOptions
|
||||
|
|
|
@ -1155,7 +1155,7 @@ export class XdsClient {
|
|||
}
|
||||
|
||||
removeClusterWatcher(clusterName: string, watcher: Watcher<Cluster__Output>) {
|
||||
trace('Watcher removed for endpoint ' + clusterName);
|
||||
trace('Watcher removed for cluster ' + clusterName);
|
||||
this.adsState[CDS_TYPE_URL].removeWatcher(clusterName, watcher);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue