Commit 0720746a authored by Robert Czechowski's avatar Robert Czechowski

Make contestreader_yaml show error and filename on parse error

parent 196b8157
Pipeline #1144 failed with stages
in 3 minutes and 53 seconds
......@@ -42,7 +42,15 @@ struct ContestYaml {
// The task path is stored relatively to the contest.yaml for easier identificationy
// Concatenation happens in functions::show_task
fn parse_yaml(content: &str, filename: &str, directory: &str) -> Option<Contest> {
let config: ContestYaml = serde_yaml::from_str(&content).unwrap();
let config: ContestYaml = match serde_yaml::from_str(&content) {
Ok(contest) => contest,
Err(e) => {
eprintln!("");
eprintln!("{}", e);
eprintln!("Error loading contest YAML: {}{}", directory, filename);
panic!("Loading contest file")
}
};
use self::time::{strptime, Timespec};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment