From a7d00f22c5c04f5ca6384423632e2da56283c091 Mon Sep 17 00:00:00 2001 From: Zagrios <40181755+Zagrios@users.noreply.github.com> Date: Wed, 19 Feb 2025 19:06:23 +0100 Subject: [PATCH] Convert throwed object to CustomError --- src/main/helpers/fs.helpers.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/helpers/fs.helpers.ts b/src/main/helpers/fs.helpers.ts index 58f8f233..d10583d2 100644 --- a/src/main/helpers/fs.helpers.ts +++ b/src/main/helpers/fs.helpers.ts @@ -3,7 +3,6 @@ import { access, mkdir, readdir, lstat, readlink } from "fs/promises"; import path from "path"; import { Observable, concatMap, from } from "rxjs"; import log from "electron-log"; -import { BsmException } from "shared/models/bsm-exception.model"; import crypto from "crypto"; import { execSync } from "child_process"; import { tryit } from "../../shared/helpers/error.helpers"; @@ -180,7 +179,7 @@ export function isSubdirectory(parent: string, child: string): boolean { export async function copyDirectoryWithJunctions(src: string, dest: string, options?: CopyOptions): Promise { if (isSubdirectory(src, dest)) { - throw { message: `Cannot copy directory '${src}' into itself '${dest}'.`, code: "COPY_TO_SUBPATH" } as BsmException; + throw new CustomError(`Cannot copy directory '${src}' into itself '${dest}'.`, "COPY_TO_SUBPATH"); } await ensureDir(dest);