File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -60,12 +60,15 @@ export default class CollectionViewProvider
60
60
// Ensure we're still connected to the correct connection.
61
61
if ( connectionId !== this . _connectionController . getActiveConnectionId ( ) ) {
62
62
operation . isCurrentlyFetchingMoreDocuments = false ;
63
+ const oldConnectionName =
64
+ this . _connectionController . getSavedConnectionName ( connectionId || '' ) ||
65
+ 'the database' ;
63
66
void vscode . window . showErrorMessage (
64
- `Unable to list documents: no longer connected to ${ connectionId } `
67
+ `Unable to list documents: no longer connected to ${ oldConnectionName } `
65
68
) ;
66
69
67
70
throw new Error (
68
- `Unable to list documents: no longer connected to ${ connectionId } `
71
+ `Unable to list documents: no longer connected to ${ oldConnectionName } `
69
72
) ;
70
73
}
71
74
@@ -74,7 +77,7 @@ export default class CollectionViewProvider
74
77
const dataservice = this . _connectionController . getActiveDataService ( ) ;
75
78
76
79
if ( dataservice === null ) {
77
- const errorMessage = ` Unable to list documents: no longer connected to ${ connectionId } ` ;
80
+ const errorMessage = ' Unable to list documents: no longer connected' ;
78
81
79
82
void vscode . window . showErrorMessage ( errorMessage ) ;
80
83
Original file line number Diff line number Diff line change @@ -309,8 +309,12 @@ export default class EditorsController {
309
309
310
310
// Ensure we're still connected to the correct connection.
311
311
if ( connectionId !== this . _connectionController . getActiveConnectionId ( ) ) {
312
+ const oldConnectionName =
313
+ this . _connectionController . getSavedConnectionName ( connectionId || '' ) ||
314
+ 'the database' ;
315
+
312
316
void vscode . window . showErrorMessage (
313
- `Unable to view more documents: no longer connected to ${ connectionId } `
317
+ `Unable to view more documents: no longer connected to ${ oldConnectionName } `
314
318
) ;
315
319
316
320
return Promise . resolve ( false ) ;
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ export default class MongoDBDocumentService {
114
114
this . _connectionController . getActiveConnectionId ( ) ;
115
115
const connectionName = connectionId
116
116
? this . _connectionController . getSavedConnectionName ( connectionId )
117
- : '' ;
117
+ : 'the database ' ;
118
118
119
119
if ( activeConnectionId !== connectionId ) {
120
120
return this . _fetchDocumentFailed (
You can’t perform that action at this time.
0 commit comments