Skip to content

Commit db41862

Browse files
committed
fix(errors): switch error to warn to fail gracefully
1 parent c8e2e1a commit db41862

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/services/error.service.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { isReactive, isRef, toRaw } from 'vue';
22

33
import type { RecursiveRecord } from '@dvcol/common-utils/common';
44

5+
import { Logger } from '~/services/logger.service';
6+
57
const toRawDeep = (obj: RecursiveRecord): RecursiveRecord => {
68
return Object.fromEntries(
79
Object.entries(obj).map(([key, value]) => {
@@ -30,7 +32,7 @@ export class ErrorService {
3032
}
3133

3234
static registerDictionary(name: string, dictionary: RecursiveRecord) {
33-
if (this._dictionaries[name]) throw new Error(`Dictionary ${name} already exists`);
35+
if (this._dictionaries[name]) Logger.warn('Overwriting dictionary', name, { was: this._dictionaries[name], is: dictionary });
3436
this._dictionaries[name] = dictionary;
3537
}
3638

0 commit comments

Comments
 (0)