@trawlme/cli 4.0.9 → 4.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/doctor.d.ts +1 -0
- package/dist/commands/doctor.js +10 -2
- package/package.json +1 -1
|
@@ -71,6 +71,7 @@ interface ScrapHead {
|
|
|
71
71
|
}
|
|
72
72
|
export declare function pickRun(run: Run): Partial<Run>;
|
|
73
73
|
export declare function pickFix(fix: FixActivity | null): Partial<FixActivity> | null;
|
|
74
|
+
export declare function errorNamesSelector(messages: Array<string | null | undefined>, selector: string): boolean;
|
|
74
75
|
export declare function formatDoctor(scrapTitle: string, run: Run, fix?: FixActivity | null, scrapId?: string): string;
|
|
75
76
|
export declare function formatAutofix(fix: FixActivity): string;
|
|
76
77
|
export declare function fetchRunAndFix(scrapId: string): Promise<{
|
package/dist/commands/doctor.js
CHANGED
|
@@ -52,6 +52,10 @@ export function pickFix(fix) {
|
|
|
52
52
|
.filter((k) => k in fix)
|
|
53
53
|
.map((k) => [k, fix[k]]));
|
|
54
54
|
}
|
|
55
|
+
export function errorNamesSelector(messages, selector) {
|
|
56
|
+
const forms = ['`', '"', "'"].map((q) => q + selector + q).concat('selector: ' + selector);
|
|
57
|
+
return messages.some((m) => !!m && forms.some((f) => m.includes(f)));
|
|
58
|
+
}
|
|
55
59
|
export function formatDoctor(scrapTitle, run, fix = null, scrapId) {
|
|
56
60
|
const lines = [];
|
|
57
61
|
const ok = run.status === true;
|
|
@@ -83,8 +87,12 @@ export function formatDoctor(scrapTitle, run, fix = null, scrapId) {
|
|
|
83
87
|
else if (errMsg && !authHintWillRender) {
|
|
84
88
|
lines.push(chalk.dim(' Error: ') + chalk.red(errMsg));
|
|
85
89
|
}
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
const selector = run.errorSnapshot?.selector;
|
|
91
|
+
if (selector) {
|
|
92
|
+
const label = errorNamesSelector([run.errorMessage, run.errorSnapshot?.errorMessage], selector)
|
|
93
|
+
? ' Failed selector: '
|
|
94
|
+
: ' Last selector tried: ';
|
|
95
|
+
lines.push(chalk.dim(label) + chalk.cyan(selector));
|
|
88
96
|
}
|
|
89
97
|
lines.push(chalk.dim(' Blocked: ') + (run.blocked ? chalk.red('yes') : 'no'));
|
|
90
98
|
if (run.proxyTier && TIER_LABELS[run.proxyTier]) {
|