Add better error message when comparing queries

Also, fix type error.
This commit is contained in:
Andrew Eisenberg
2020-06-22 11:06:10 -07:00
parent 6ae6e91195
commit 6f46bcc459

View File

@@ -554,7 +554,7 @@ the file in the file explorer and dragging it into the workspace.`
return otherQuery;
}
if (multiSelect.length > 1) {
if (multiSelect?.length > 1) {
throw new Error('Please select no more than 2 queries.');
}
@@ -572,6 +572,9 @@ the file in the file explorer and dragging it into the workspace.`
detail: otherQuery.statusString,
query: otherQuery,
}));
if (comparableQueryLabels.length < 1) {
throw new Error('No other queries available to compare with.');
}
const choice = await vscode.window.showQuickPick(comparableQueryLabels);
return choice?.query;
}