diff options
author | Ian Bull <irbull@eclipsesource.com> | 2024-10-01 11:26:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-01 14:26:06 -0400 |
commit | 41a70898adfc61b9020dfdfec17d374aac70d935 (patch) | |
tree | 58784454868f2a2b2501babb50b78c1dd85e5f3a /ext/net | |
parent | 4c8d57db03bac12d2a13566b3cc7454cfbd67314 (diff) |
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
<!--
Before submitting a PR, please read
https://docs.deno.com/runtime/manual/references/contributing
1. Give the PR a descriptive title.
Examples of good title:
- fix(std/http): Fix race condition in server
- docs(console): Update docstrings
- feat(doc): Handle nested reexports
Examples of bad title:
- fix #7123
- update docs
- fix bugs
2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
7. Open as a draft PR if your work is still in progress. The CI won't
run
all steps, but you can add '[ci]' to a commit message to force it to.
8. If you would like to run the benchmarks on the CI, add the 'ci-bench'
label.
-->
Diffstat (limited to 'ext/net')
-rw-r--r-- | ext/net/02_tls.js | 8 |
1 files changed, 5 insertions, 3 deletions
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}\``, ); } |