@@ -842,25 +842,25 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
842
842
vscode . commands . registerCommand ( "vscode-objectscript.pickProcess" , async ( config ) => {
843
843
const system = config . system ;
844
844
const api = new AtelierAPI ( vscode . window . activeTextEditor ?. document . uri ) ;
845
- const convert = async ( jobData ) => {
846
- // NOTE: We do not know if the current user has permissions to other namespaces, so lets only fetch the job infos
847
- // for the current namespace.
845
+
846
+ const list = await api . getJobs ( system ) . then ( async ( jobData ) => {
847
+ // NOTE: We do not know if the current user has permissions to other namespaces
848
+ // so lets only fetch the job info for the current namespace
848
849
const currNamespaceJobs : { [ k : string ] : string } = await api
849
- . actionQuery ( "SELECT Job, ConfigName FROM Ens.Job_Enumerate() where State = 'Alive'" , [ ] )
850
+ . actionQuery ( "SELECT Job, ConfigName FROM Ens.Job_Enumerate() WHERE State = 'Alive'" , [ ] )
850
851
. then ( ( data ) => Object . fromEntries ( data . result . content . map ( ( x ) => [ x . Job , x . ConfigName ] ) ) )
851
852
. catch ( ( error ) => {
852
- // Current namespace is not Interoperability-enabled, there is no Ens.Job_Enumerate procedure
853
- if ( error && error . errorText . includes ( "'ENS.JOB_ENUMERATE'(...)" ) ) {
854
- return { } ;
855
- }
856
-
857
- let message = `Failed to fetch namespace '${ api . ns } ' job config names.` ;
858
- if ( error && error . errorText && error . errorText !== "" ) {
853
+ if (
854
+ error &&
855
+ error . errorText &&
856
+ ! error . errorText . includes ( "'ENS.JOB_ENUMERATE'(...)" ) &&
857
+ error . errorText != ""
858
+ ) {
859
+ // Hide errors about Ens.Job_Enumerate procedure not existing because
860
+ // the current namespace may not be Interoperability-enabled
859
861
outputChannel . appendLine ( "\n" + error . errorText ) ;
860
862
outputChannel . show ( true ) ;
861
- message += " Check 'ObjectScript' output channel for details." ;
862
863
}
863
- vscode . window . showErrorMessage ( message , "Dismiss" ) ;
864
864
return { } ;
865
865
} ) ;
866
866
@@ -879,9 +879,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
879
879
} ;
880
880
}
881
881
} ) ;
882
- } ;
883
-
884
- const list = await api . getJobs ( system ) . then ( convert ) ;
882
+ } ) ;
885
883
if ( ! list . length ) {
886
884
vscode . window . showInformationMessage ( `No attachable processes are running in ${ api . ns } .` , {
887
885
modal : true ,
0 commit comments