File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -48,10 +48,17 @@ async function listDataResources(dataPackageUri: Uri): Promise<void> {
4848 dataPackageUrl = dataPackageUri . fsPath ;
4949 }
5050
51- // load data package
52- const dataPackage : any = await DataPackage . Package . load ( dataPackageUrl ) ;
53- // console.log('tabular.data.package:', dataPackage);
54- // console.log('tabular.data.package.resources:', dataPackage.resources);
51+ let dataPackage : any = undefined ;
52+ try {
53+ // load data package
54+ dataPackage = await DataPackage . Package . load ( dataPackageUrl ) ;
55+ // console.log('tabular.data.package:', dataPackage);
56+ // console.log('tabular.data.package.resources:', dataPackage.resources);
57+ }
58+ catch ( error : any ) {
59+ window . showErrorMessage ( error . message ) ;
60+ return ;
61+ }
5562
5663 // get data package resources
5764 const dataResources : Array < QuickPickItem > = [ ] ;
@@ -61,7 +68,7 @@ async function listDataResources(dataPackageUri: Uri): Promise<void> {
6168
6269 // construct github repository resource Url
6370 let resourceUrl : string = fileUtils . convertToGitHubRepositoryUrl ( resource . source ) ;
64-
71+
6572 if ( dataPackageUri . scheme === 'file' ) {
6673 // create local resource path using data package Uri as resource base path
6774 const resourceUri : Uri = Uri . joinPath ( dataPackageUri , `../${ resource . source } ` ) ;
You can’t perform that action at this time.
0 commit comments