Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error-handling of Mongo shell commands #1105

Closed
wants to merge 3 commits into from

Conversation

StephenWeatherford
Copy link
Contributor

@StephenWeatherford StephenWeatherford commented May 2, 2019

This especially should provide accurate error messages instead of "timed out" when the "use db" command fails.

Fixes #838
Also fixes #1104

Possibly fixes error reporting for:
#1071
#988
#852
#820
#794
#1092

The main part is a near-rewrite of shell.ts.

Testcases in OneNote:
image

@StephenWeatherford StephenWeatherford requested a review from a team as a code owner May 2, 2019 22:13
@StephenWeatherford StephenWeatherford force-pushed the saw/shellerrors4 branch 2 times, most recently from 058107b to 2758796 Compare May 2, 2019 23:19
src/mongo/shell.ts Outdated Show resolved Hide resolved
src/mongo/shell.ts Show resolved Hide resolved
src/mongo/shell.ts Show resolved Hide resolved
src/mongo/shell.ts Outdated Show resolved Hide resolved
src/mongo/shell.ts Show resolved Hide resolved
src/mongo/shell.ts Show resolved Hide resolved
src/mongo/shell.ts Show resolved Hide resolved
src/mongo/tree/MongoDatabaseTreeItem.ts Show resolved Hide resolved
src/mongo/tree/MongoDatabaseTreeItem.ts Show resolved Hide resolved
package.json Show resolved Hide resolved
@StephenWeatherford
Copy link
Contributor Author

@EricJizbaMSFT @PrashanthCorp @nturinski FYI, I was trying to get this finished up yesterday and also greatly simply the algorithm by passing the script to be processed through the command line instead of stdin (which would allow me to use Eric's cpUtils unchanged. Unfortunately, it causes some differences in output that I don't think I can overcome. The problem with using cpUtils is that as currently written the mongo shell execution requires an interactive handshaking with stdin/stdout. Probably giving it a rest until next week, but want to get it out of the way. Also wondered if it would make sense to use the vscode terminal for this (but we'd have to be able to read the output).

@ejizba
Copy link
Member

ejizba commented Jul 3, 2019

That would've been great if we could just re-use cpUtils, but honestly not that surprised that it didn't work. Oh well ¯\_(ツ)_/¯

@StephenWeatherford
Copy link
Contributor Author

That would've been great if we could just re-use cpUtils, but honestly not that surprised that it didn't work. Oh well ¯_(ツ)_/¯

It was so close.

@StephenWeatherford
Copy link
Contributor Author

Superseded by #1148

@StephenWeatherford StephenWeatherford deleted the saw/shellerrors4 branch September 3, 2019 19:08
@github-actions github-actions bot locked and limited conversation to collaborators Apr 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants