@@ -5,6 +5,9 @@ import { AtelierAPI } from "../api";
55import { connectionTarget , currentFile , getWsServerConnection , handleError , notIsfs , outputChannel } from "../utils" ;
66import { config , iscIcon , resolveConnectionSpec } from "../extension" ;
77
8+ const NO_ELIGIBLE_CONNECTIONS =
9+ "Lite Terminal requires an active server connection to InterSystems IRIS version 2023.2 or above." ;
10+
811const keys = {
912 enter : "\r" ,
1013 backspace : "\x7f" ,
@@ -766,6 +769,9 @@ export async function launchWebSocketTerminal(targetUri?: vscode.Uri): Promise<v
766769 } else {
767770 // Determine the server connection to use
768771 targetUri = currentFile ( ) ?. uri ?? ( await getWsServerConnection ( "2023.2.0" ) ) ;
772+ if ( targetUri === undefined ) {
773+ vscode . window . showErrorMessage ( NO_ELIGIBLE_CONNECTIONS ) ;
774+ }
769775 if ( ! targetUri ) return ;
770776 }
771777 const api = new AtelierAPI ( targetUri ) ;
@@ -791,10 +797,10 @@ export class WebSocketTerminalProfileProvider implements vscode.TerminalProfileP
791797 // Get the terminal configuration. Will throw if there's an error.
792798 const terminalOpts = terminalConfigForUri ( new AtelierAPI ( uri ) , uri , true ) ;
793799 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." ) ;
798804 }
799805 }
800806}
0 commit comments