jazzdotdev / jazz

The Scripting Engine that Combines Speed, Safety, and Simplicity
Apache License 2.0
146 stars 11 forks source link

if parsing settings.toml fails, show that in an error #73

Open naturallymitchell opened 5 years ago

naturallymitchell commented 5 years ago

with lua prelude instead of lua-prelude, got this: thread 'main' panicked at 'calledResult::unwrap()on anErrvalue: expected an equals, found an identifier at line 1 in Settings.toml', libcore/result.rs:1009:5

dariusc93 commented 5 years ago

We could do something like

match settings.merge(config::File::with_name("Settings.toml")) {
     Ok(_) => {},
     Err(e) => {
          println!("Error opening Settings.toml: {}", e);
          return;
     }
};

Which wont throw a panic but would still display the error and would not continue the execution of the function