mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode 709a07d51919d3266ca71699c6ddfb2d3547c0e1 (#6575)
This commit is contained in:
@@ -79,11 +79,25 @@ export class Workbench extends Layout {
|
||||
setUnexpectedErrorHandler(error => this.handleUnexpectedError(error, logService));
|
||||
|
||||
// Inform user about loading issues from the loader
|
||||
interface AnnotatedLoadingError extends Error {
|
||||
phase: 'loading';
|
||||
moduleId: string;
|
||||
neededBy: string[];
|
||||
}
|
||||
interface AnnotatedFactoryError extends Error {
|
||||
phase: 'factory';
|
||||
moduleId: string;
|
||||
}
|
||||
interface AnnotatedValidationError extends Error {
|
||||
phase: 'configuration';
|
||||
}
|
||||
type AnnotatedError = AnnotatedLoadingError | AnnotatedFactoryError | AnnotatedValidationError;
|
||||
(<any>window).require.config({
|
||||
onError: (err: { errorCode: string; }) => {
|
||||
if (err.errorCode === 'load') {
|
||||
onError: (err: AnnotatedError) => {
|
||||
if (err.phase === 'loading') {
|
||||
onUnexpectedError(new Error(localize('loaderErrorNative', "Failed to load a required file. Please restart the application to try again. Details: {0}", JSON.stringify(err))));
|
||||
}
|
||||
console.error(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user