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