File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,23 @@ export class DeepnoteContentProvider extends RestContentProvider {
1717 }
1818
1919 // Call custom API route to fetch the Deepnote file content
20- const data = await requestAPI < any > ( `file?path=${ localPath } ` ) ;
20+ let data : any ;
21+
22+ try {
23+ data = await requestAPI < any > (
24+ `file?path=${ encodeURIComponent ( localPath ) } `
25+ ) ;
26+ } catch ( error ) {
27+ console . error ( `Failed to fetch Deepnote file: ${ localPath } ` , error ) ;
28+ throw new Error ( `Failed to fetch .deepnote file: ${ error } ` ) ;
29+ }
30+
31+ if ( ! data . deepnoteFileModel ) {
32+ throw new Error (
33+ `Invalid API response: missing deepnoteFileModel for ${ localPath } `
34+ ) ;
35+ }
36+
2137 const modelData = data . deepnoteFileModel ;
2238
2339 // Transform the Deepnote YAML to Jupyter notebook content
You can’t perform that action at this time.
0 commit comments