@@ -91,7 +91,7 @@ export default class OpenShiftItem {
9191
9292 static async getProjectNames ( ) : Promise < OpenShiftObject [ ] > {
9393 const projectList : Array < OpenShiftObject > = await OpenShiftItem . odo . getProjects ( ) ;
94- if ( projectList . length === 0 ) throw Error ( errorMessage . Project ) ;
94+ if ( projectList . length === 0 ) throw new VsCommandError ( errorMessage . Project ) ;
9595 return projectList ;
9696 }
9797
@@ -106,25 +106,25 @@ export default class OpenShiftItem {
106106
107107 static async getComponentNames ( application : OpenShiftObject , condition ?: ( value : OpenShiftObject ) => boolean ) : Promise < OpenShiftObject [ ] > {
108108 const applicationList : Array < OpenShiftObject > = await OpenShiftItem . odo . getComponents ( application , condition ) ;
109- if ( applicationList . length === 0 ) throw Error ( errorMessage . Component ) ;
109+ if ( applicationList . length === 0 ) throw new VsCommandError ( errorMessage . Component ) ;
110110 return applicationList ;
111111 }
112112
113113 static async getServiceNames ( application : OpenShiftObject ) : Promise < OpenShiftObject [ ] > {
114114 const serviceList : Array < OpenShiftObject > = await OpenShiftItem . odo . getServices ( application ) ;
115- if ( serviceList . length === 0 ) throw Error ( errorMessage . Service ) ;
115+ if ( serviceList . length === 0 ) throw new VsCommandError ( errorMessage . Service ) ;
116116 return serviceList ;
117117 }
118118
119119 static async getStorageNames ( component : OpenShiftObject ) : Promise < OpenShiftObject [ ] > {
120120 const storageList : Array < OpenShiftObject > = await OpenShiftItem . odo . getStorageNames ( component ) ;
121- if ( storageList . length === 0 ) throw Error ( errorMessage . Storage ) ;
121+ if ( storageList . length === 0 ) throw new VsCommandError ( errorMessage . Storage ) ;
122122 return storageList ;
123123 }
124124
125125 static async getRoutes ( component : OpenShiftObject ) : Promise < OpenShiftObject [ ] > {
126126 const urlList : Array < OpenShiftObject > = await OpenShiftItem . odo . getRoutes ( component ) ;
127- if ( urlList . length === 0 ) throw Error ( errorMessage . Route ) ;
127+ if ( urlList . length === 0 ) throw new VsCommandError ( errorMessage . Route ) ;
128128 return urlList ;
129129 }
130130
0 commit comments