Do not overwrite error 'metadata' if already specified by caller.

This commit is contained in:
Cyrus Najmabadi 2020-01-13 14:48:38 -08:00
parent fa20c5e565
commit 7e1d20fec1
1 changed files with 3 additions and 1 deletions

View File

@ -455,7 +455,9 @@ export class Http2ServerCallStream<
}
if (err) {
err.metadata = metadata;
if (!err.hasOwnProperty('metadata')) {
err.metadata = metadata;
}
this.sendError(err);
return;
}