From 41a70898adfc61b9020dfdfec17d374aac70d935 Mon Sep 17 00:00:00 2001 From: Ian Bull Date: Tue, 1 Oct 2024 11:26:06 -0700 Subject: refactor(ext): align error messages (#25914) Aligns the error messages in the ext folder to be in-line with the Deno style guide. https://github.com/denoland/deno/issues/25269 --- ext/net/02_tls.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'ext/net') diff --git a/ext/net/02_tls.js b/ext/net/02_tls.js index 11d19440f..6dad96559 100644 --- a/ext/net/02_tls.js +++ b/ext/net/02_tls.js @@ -124,17 +124,19 @@ function loadTlsKeyPair(api, { // Check for "pem" format if (keyFormat !== undefined && keyFormat !== "pem") { - throw new TypeError('If `keyFormat` is specified, it must be "pem"'); + throw new TypeError( + `If "keyFormat" is specified, it must be "pem": received "${keyFormat}"`, + ); } if (cert !== undefined && key === undefined) { throw new TypeError( - `If \`cert\` is specified, \`key\` must be specified as well for \`${api}\`.`, + `If \`cert\` is specified, \`key\` must be specified as well for \`${api}\``, ); } if (cert === undefined && key !== undefined) { throw new TypeError( - `If \`key\` is specified, \`cert\` must be specified as well for \`${api}\`.`, + `If \`key\` is specified, \`cert\` must be specified as well for \`${api}\``, ); } -- cgit v1.2.3