mirror of https://github.com/grpc/grpc-node.git
grpc-js: Add detail to invalid metadata error
This commit is contained in:
parent
1d157dfd10
commit
989288c1f0
|
@ -16,6 +16,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as http2 from 'http2';
|
import * as http2 from 'http2';
|
||||||
|
import { log } from './logging';
|
||||||
|
import { LogVerbosity } from './constants';
|
||||||
const LEGAL_KEY_REGEX = /^[0-9a-z_.-]+$/;
|
const LEGAL_KEY_REGEX = /^[0-9a-z_.-]+$/;
|
||||||
const LEGAL_NON_BINARY_VALUE_REGEX = /^[ -~]*$/;
|
const LEGAL_NON_BINARY_VALUE_REGEX = /^[ -~]*$/;
|
||||||
|
|
||||||
|
@ -272,8 +274,8 @@ export class Metadata {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
error.message = `Failed to add metadata entry ${key}: ${values}. ${error.message}`;
|
const message = `Failed to add metadata entry ${key}: ${values}. ${error.message}. For more information see https://github.com/grpc/grpc-node/issues/1173`;
|
||||||
process.emitWarning(error);
|
log(LogVerbosity.ERROR, message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue