Skip to content

Commit d62d372

Browse files
committed
fix: return proper error message when workspace is null in importModeWithRules
- Fixed error handling in importModeWithRules to return 'No workspace found' error instead of letting path.join() throw when workspace is null - This fixes the failing unit test in CustomModesManager.spec.ts
1 parent 2374a3d commit d62d372

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/core/config/CustomModesManager.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,8 +625,7 @@ export class CustomModesManager {
625625
if (source === "project" && rulesFiles && Array.isArray(rulesFiles)) {
626626
const workspacePath = getWorkspacePath()
627627
if (!workspacePath) {
628-
logger.warn("No workspace found for project-level import, skipping rules files")
629-
continue
628+
return { success: false, error: "No workspace found" }
630629
}
631630

632631
// First, remove the existing rules folder for this mode if it exists

0 commit comments

Comments
 (0)