We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f776bca commit d335054Copy full SHA for d335054
1 file changed
crates/common/src/config/mux.rs
@@ -123,6 +123,17 @@ impl MuxConfig {
123
pub fn loader_env(&self) -> Option<(String, String, String)> {
124
self.loader.as_ref().and_then(|loader| match loader {
125
MuxKeysLoader::File(path_buf) => {
126
+ if !path_buf.try_exists().is_ok_and(|exists| exists) {
127
+ panic!("path doesn't exist: {:?}", path_buf);
128
+ }
129
+
130
+ if !path_buf
131
+ .file_name()
132
+ .is_some_and(|name| name.to_string_lossy().to_lowercase().ends_with(".json"))
133
+ {
134
+ panic!("file doesn't have a .json extension");
135
136
137
let path =
138
path_buf.to_str().unwrap_or_else(|| panic!("invalid path: {:?}", path_buf));
139
let internal_path = get_mux_path(&self.id);
0 commit comments