mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-28 05:39:34 +08:00
style: some format adjustments
This commit is contained in:
@@ -66,25 +66,23 @@ export function scriptErrorHandler(
|
||||
if (event === 'Script error.' && !source) {
|
||||
return false;
|
||||
}
|
||||
setTimeout(function () {
|
||||
const errorInfo: Partial<ErrorInfo> = {};
|
||||
colno = colno || (window.event && (window.event as any).errorCharacter) || 0;
|
||||
errorInfo.message = event as string;
|
||||
if (error && error.stack) {
|
||||
errorInfo.stack = error.stack;
|
||||
} else {
|
||||
errorInfo.stack = '';
|
||||
}
|
||||
const name = source ? source.substr(source.lastIndexOf('/') + 1) : 'script';
|
||||
errorStore.commitErrorInfoState({
|
||||
type: ErrorTypeEnum.SCRIPT,
|
||||
name: name,
|
||||
file: source as string,
|
||||
detail: 'lineno' + lineno,
|
||||
url: window.location.href,
|
||||
...(errorInfo as Pick<ErrorInfo, 'message' | 'stack'>),
|
||||
});
|
||||
}, 0);
|
||||
const errorInfo: Partial<ErrorInfo> = {};
|
||||
colno = colno || (window.event && (window.event as any).errorCharacter) || 0;
|
||||
errorInfo.message = event as string;
|
||||
if (error && error.stack) {
|
||||
errorInfo.stack = error.stack;
|
||||
} else {
|
||||
errorInfo.stack = '';
|
||||
}
|
||||
const name = source ? source.substr(source.lastIndexOf('/') + 1) : 'script';
|
||||
errorStore.commitErrorInfoState({
|
||||
type: ErrorTypeEnum.SCRIPT,
|
||||
name: name,
|
||||
file: source as string,
|
||||
detail: 'lineno' + lineno,
|
||||
url: window.location.href,
|
||||
...(errorInfo as Pick<ErrorInfo, 'message' | 'stack'>),
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user