@@ -5,6 +5,9 @@ import { AtelierAPI } from "../api";
5
5
import { connectionTarget , currentFile , getWsServerConnection , handleError , notIsfs , outputChannel } from "../utils" ;
6
6
import { config , iscIcon , resolveConnectionSpec } from "../extension" ;
7
7
8
+ const NO_ELIGIBLE_CONNECTIONS =
9
+ "Lite Terminal requires an active server connection to InterSystems IRIS version 2023.2 or above." ;
10
+
8
11
const keys = {
9
12
enter : "\r" ,
10
13
backspace : "\x7f" ,
@@ -766,6 +769,9 @@ export async function launchWebSocketTerminal(targetUri?: vscode.Uri): Promise<v
766
769
} else {
767
770
// Determine the server connection to use
768
771
targetUri = currentFile ( ) ?. uri ?? ( await getWsServerConnection ( "2023.2.0" ) ) ;
772
+ if ( targetUri === undefined ) {
773
+ vscode . window . showErrorMessage ( NO_ELIGIBLE_CONNECTIONS ) ;
774
+ }
769
775
if ( ! targetUri ) return ;
770
776
}
771
777
const api = new AtelierAPI ( targetUri ) ;
@@ -791,10 +797,10 @@ export class WebSocketTerminalProfileProvider implements vscode.TerminalProfileP
791
797
// Get the terminal configuration. Will throw if there's an error.
792
798
const terminalOpts = terminalConfigForUri ( new AtelierAPI ( uri ) , uri , true ) ;
793
799
return new vscode . TerminalProfile ( terminalOpts ) ;
794
- } else if ( uri == undefined ) {
795
- throw new Error (
796
- "Lite Terminal requires an active server connection to InterSystems IRIS version 2023.2 or above."
797
- ) ;
800
+ } else if ( uri === undefined ) {
801
+ throw new Error ( NO_ELIGIBLE_CONNECTIONS ) ;
802
+ } else {
803
+ throw new Error ( "No connection was chosen." ) ;
798
804
}
799
805
}
800
806
}
0 commit comments