mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
catch exceptions in shell
This commit is contained in:
parent
665b1f7483
commit
a78800d5b8
@ -444,9 +444,14 @@ int _main(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
if ( ! wascmd ){
|
||||
try {
|
||||
scope->exec( code.c_str() , "(shell)" , false , true , false );
|
||||
scope->exec( "shellPrintHelper( __lastres__ );" , "(shell2)" , true , true , false );
|
||||
}
|
||||
catch ( std::exception& e ){
|
||||
cout << "error:" << e.what() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
shellHistoryAdd( line );
|
||||
|
Loading…
Reference in New Issue
Block a user