docs: better error message when failed loading

This commit is contained in:
tiddlygit-test 2021-06-29 00:16:24 +08:00
parent df353131aa
commit 7bfdae7940
4 changed files with 18 additions and 4 deletions

View file

@ -0,0 +1,9 @@
import i18n from '@services/libs/i18n';
export class WorkspaceFailedToLoadError extends Error {
constructor(extraMessage?: string, url?: string) {
super(extraMessage);
this.name = i18n.t('Error.WorkspaceFailedToLoadError');
this.message = `${i18n.t('Error.WorkspaceFailedToLoadErrorDescription')} ${extraMessage ?? ''} ${url ?? ''}`;
}
}