mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
docs(cli): align additional error messages (#5768)
This commit is contained in:
parent
b289deecbe
commit
46b3961833
@ -34,7 +34,7 @@ async function fetchUnicodeData(filename: string, version: string) {
|
||||
);
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error(`Failed to fetch ${filename}`);
|
||||
throw new Error(`Failed to fetch ${filename}: status ${res.status}`);
|
||||
}
|
||||
|
||||
return await res.text();
|
||||
@ -245,12 +245,12 @@ class Table {
|
||||
|
||||
indicesToWidths() {
|
||||
if (!this.indexed) {
|
||||
throw new Error(`Can't call indicesToWidths twice on the same Table`);
|
||||
throw new Error(`Cannot call indicesToWidths twice on the same table`);
|
||||
}
|
||||
|
||||
this.entries = this.entries.map((i) => {
|
||||
const width = this.indexed[i]!.width();
|
||||
if (width === null) throw new TypeError("width cannot be null");
|
||||
if (width === null) throw new TypeError("'width' cannot be null");
|
||||
return width!;
|
||||
});
|
||||
|
||||
@ -259,7 +259,7 @@ class Table {
|
||||
|
||||
get buckets() {
|
||||
if (!this.indexed) {
|
||||
throw new Error(`Can't access buckets after calling indicesToWidths`);
|
||||
throw new Error(`Cannot access buckets after calling indicesToWidths`);
|
||||
}
|
||||
|
||||
return this.indexed;
|
||||
|
@ -38,7 +38,7 @@ export type PromptSecretOptions = {
|
||||
*
|
||||
* const password = promptSecret("Please provide the password:");
|
||||
* if (password !== "some-password") {
|
||||
* throw new Error("Access denied.");
|
||||
* throw new Error("Access denied");
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user