mirror of
https://github.com/maplibre/maplibre-rs.git
synced 2025-12-08 19:05:57 +00:00
Improve error messages
This commit is contained in:
parent
f78708adc2
commit
5201279e8c
@ -67,14 +67,23 @@ pub fn validate_project_wgsl() {
|
|||||||
Ok(_) => {}
|
Ok(_) => {}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
let path = path.strip_prefix(&root_dir).unwrap_or(path);
|
let path = path.strip_prefix(&root_dir).unwrap_or(path);
|
||||||
println!("cargo:warning=Error ({:?}): {:?}", path, err);
|
println!(
|
||||||
|
"cargo:warning={}: {}",
|
||||||
|
path.to_str().unwrap(),
|
||||||
|
match err {
|
||||||
|
WgslError::ValidationErr(error) => format!("{:?}", error),
|
||||||
|
WgslError::ParserErr { error, line, pos } =>
|
||||||
|
format!("{}", error),
|
||||||
|
WgslError::IoErr(error) => format!("{:?}", error),
|
||||||
|
}
|
||||||
|
);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(error) => {
|
||||||
println!("cargo:warning=Error: {:?}", err);
|
println!("cargo:warning={}", format!("{:?}", error));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user