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:
Michael Lumish 2021-01-28 12:30:35 -08:00 committed by GitHub
commit 98376f0ac6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -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": {

View File

@ -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

View File

@ -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);
}