perf(ui): instantiate logger for storage error handler once

This commit is contained in:
psychedelicious
2025-07-29 19:47:22 +10:00
parent c3c1a3edd8
commit a44de079dd

View File

@@ -33,8 +33,9 @@ export class StorageError extends Error {
}
}
const log = logger('system');
export const errorHandler = (err: PersistError | RehydrateError) => {
const log = logger('system');
if (err instanceof PersistError) {
log.error({ error: serializeError(err) }, 'Problem persisting state');
} else if (err instanceof RehydrateError) {