|
@@ -579,11 +579,12 @@ export class Context<T extends DocumentRegistry.IModel>
|
|
return this._populate();
|
|
return this._populate();
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- .catch(err => {
|
|
|
|
|
|
+ .catch(async err => {
|
|
const localPath = this._manager.contents.localPath(this._path);
|
|
const localPath = this._manager.contents.localPath(this._path);
|
|
const name = PathExt.basename(localPath);
|
|
const name = PathExt.basename(localPath);
|
|
|
|
+ const response = await err.response.json();
|
|
if (err.message === 'Invalid response: 400 bad format') {
|
|
if (err.message === 'Invalid response: 400 bad format') {
|
|
- err = new Error('JupyterLab is unable to open this file type.');
|
|
|
|
|
|
+ err = new Error(response.message);
|
|
}
|
|
}
|
|
void this._handleError(err, `File Load Error for ${name}`);
|
|
void this._handleError(err, `File Load Error for ${name}`);
|
|
throw err;
|
|
throw err;
|