Skip to content

Commit c89faab

Browse files
authored
Merge pull request #2574 from me-diru/error-msg-app-root
fix: add error message when file path outside root
2 parents bc86ff3 + 01f408a commit c89faab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/loader/src/local.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,10 @@ impl LocalLoader {
416416
continue;
417417
}
418418

419-
let app_root_path = src.strip_prefix(&self.app_root)?;
419+
let Ok(app_root_path) = src.strip_prefix(&self.app_root) else {
420+
bail!("{pattern} cannot be mapped because it is outside the application directory. Files must be within the application directory.");
421+
};
422+
420423
if exclude_patterns
421424
.iter()
422425
.any(|pattern| pattern.matches_path(app_root_path))

0 commit comments

Comments
 (0)