mirror of
https://github.com/mediacms-io/mediacms.git
synced 2026-03-22 20:43:10 -04:00
refactor(frontend): replace legacy utils JS files with typed TS equivalents
This commit is contained in:
15
frontend/src/static/js/utils/helpers/errors.ts
Executable file
15
frontend/src/static/js/utils/helpers/errors.ts
Executable file
@@ -0,0 +1,15 @@
|
||||
// @todo: Improve or (even better) remove this file.
|
||||
|
||||
import { error, warn } from './log';
|
||||
|
||||
export function logErrorAndReturnError(msgArr: string[]) {
|
||||
const err = new Error(msgArr[0]);
|
||||
error(...msgArr);
|
||||
return err;
|
||||
}
|
||||
|
||||
export function logWarningAndReturnError(msgArr: string[]) {
|
||||
const err = new Error(msgArr[0]);
|
||||
warn(...msgArr);
|
||||
return err;
|
||||
}
|
||||
Reference in New Issue
Block a user